Re: [SQL] replace " with nothing

2011-05-12 Thread Lew
Tony Capobianco wrote: We are converting from Oracle to Postgres. An Oracle script contains this line: select replace(firstname,'"'), memberid, emailaddress from members; in an effort to replace the " with nothing. How can I achieve the same result with Postgres? Here's the Postgres error

Re: [SQL] replace " with nothing

2011-05-11 Thread Leif Biberg Kristensen
On Wednesday 11 May 2011 23:25:34 Ross J. Reedstrom wrote: > On Wed, May 11, 2011 at 11:11:07PM +0200, Leif Biberg Kristensen wrote: > > although it's a little above me why you would want to select firstname in > > the first place when you proceed to replace it with nothing. > > Nah, he's replacin

Re: [SQL] replace " with nothing

2011-05-11 Thread Ross J. Reedstrom
On Wed, May 11, 2011 at 11:11:07PM +0200, Leif Biberg Kristensen wrote: > > although it's a little above me why you would want to select firstname in the > first place when you proceed to replace it with nothing. Nah, he's replacing double-quote-character " with nothing. An attempt to protect a

Re: [SQL] replace " with nothing

2011-05-11 Thread Ross J. Reedstrom
On Wed, May 11, 2011 at 04:51:05PM -0400, Tony Capobianco wrote: > Ok, I think I found it: > > select translate(firstname,'"','') from members; > > gives me what I want. Yup, you beat me to the answer. For the archives, if this was a compatability question (for example, you've got framework code

Re: [SQL] replace " with nothing

2011-05-11 Thread Leif Biberg Kristensen
On Wednesday 11 May 2011 22:29:40 Tony Capobianco wrote: > We are converting from Oracle to Postgres. An Oracle script contains > this line: > > select replace(firstname,'"'), memberid, emailaddress from members; > > in an effort to replace the " with nothing. How can I achieve the same > resu

Re: [SQL] replace " with nothing

2011-05-11 Thread Tony Capobianco
Ok, I think I found it: select translate(firstname,'"','') from members; gives me what I want. Thanks. On Wed, 2011-05-11 at 16:29 -0400, Tony Capobianco wrote: > We are converting from Oracle to Postgres. An Oracle script contains > this line: > > select replace(firstname,'"'), memberid, em

[SQL] replace " with nothing

2011-05-11 Thread Tony Capobianco
We are converting from Oracle to Postgres. An Oracle script contains this line: select replace(firstname,'"'), memberid, emailaddress from members; in an effort to replace the " with nothing. How can I achieve the same result with Postgres? Here's the Postgres error I get: select replace(fir