Thread: Re: [INTERFACES] Still have problem with single quotation mark

Re: [INTERFACES] Still have problem with single quotation mark

From
Andreas Theofilu
Date:
Am Mo, 13 Sep 1999 schrieben Sie:
> On Mon, 13 Sep 1999, you wrote:
> >Hi to all,
> >
> >There is still a problem with the single quotation mark (') inside a
> >string, when this string is inserted into the database and one uses 'ecpg'.
> >Someone on this list told me, that I should precede a ' with a second '
> >(''). 
> 
> This is incorrect. You quote apostrophes with the backslash, so if my string
> was "that's", I would represent it as "that\'s" 

It would be nice if I could do so, but at least with 'ecpg' I can't realy
do this. As already written, if I quote the apostrophes with a backslash
(that\'s), I get the run time error "too many arguments in line xxx". The
same happens if I don't quote at all. Only quoting the apostrophe with an
apostrophe gives no runtime error, but then I have the two apostrophes in
the database. This is not what I expected.
While playing around with ecpg I'm sure now, that 'ecpg' does something
wrong here. The problem is in the library 'libecpg.so'. I will try to find
out the error...
-- 
Theofilu Andreas
http://members.eunet.at/theofilu
              -------------------------------------------------                          Enjoy the science of Linux!
                 Genie�e die Wissenschaft von Linux!              -------------------------------------------------
 


Re: [INTERFACES] Still have problem with single quotation mark

From
Michael Meskes
Date:
On Tue, Sep 14, 1999 at 07:47:24AM +0200, Andreas Theofilu wrote:
> > >Someone on this list told me, that I should precede a ' with a second '
> > >(''). 
> > 
> > This is incorrect. You quote apostrophes with the backslash, so if my string
> > was "that's", I would represent it as "that\'s" 

Not exactly. SQL/92-standard says that ' is quored by adding a second '.

ECPG should support both.

> (that\'s), I get the run time error "too many arguments in line xxx". The
> same happens if I don't quote at all. Only quoting the apostrophe with an

Yup, I know this bug. Please try upgrading ecpg to at least 2.6.1 and try
again. If you need the source I'm willing to send it via email.

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!