pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedStill have problem with single quotation mark
5+ messages / 4 participants
[nested] [flat]
* Still have problem with single quotation mark
@ 1999-09-13 20:11 Theofilu Andreas <theofilu@eunet.at>
0 siblings, 1 reply; 5+ messages in thread
From: theofilu@eunet.at @ 1999-09-13 20:11 UTC (permalink / raw)
To: pgsql-interfaces
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 '
(''). Then it would not be interpreted as the end of string. I did this and
realy, now it is not interpreted at all. 'ecpg' puts now both quotation
marks into the database table. This makes for example the words 'I don't
want this' appear as 'I don''t want this'. Preceding the quotation mark
with a backslash does not help also. Then I get the SQL error 'too many
arguments in line xxx'. This is really annoying. How can I fix this?
--
Theofilu Andreas
http://members.eunet.at/theofilu
-------------------------------------------------
Enjoy the science of Linux!
Genieße die Wissenschaft von Linux!
-------------------------------------------------
^ permalink raw reply [nested|flat] 5+ messages in thread
* RE: [INTERFACES] Still have problem with single quotation mark
@ 1999-09-13 20:26 Michael Wentzel <wentzel@THWT.COM>
0 siblings, 0 replies; 5+ messages in thread
From: Michael Wentzel @ 1999-09-13 20:26 UTC (permalink / raw)
To: 'theofilu@eunet.at' <theofilu@eunet.at>; +Cc: pgsql-interfaces
>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 '
>(''). Then it would not be interpreted as the end of string. I did this and
>realy, now it is not interpreted at all. 'ecpg' puts now both quotation
>marks into the database table. This makes for example the words 'I don't
>want this' appear as 'I don''t want this'. Preceding the quotation mark
>with a backslash does not help also. Then I get the SQL error 'too many
>arguments in line xxx'. This is really annoying. How can I fix this?
Try escape characters. For example to place a single quote in a text field
use \' instead of ' the backslash tells SQL interpreter that the next
character
is not a special character but simply part of the string. Other examples
are:
\\ interprets as a single backslash character in the string
\" interprets as a double quote character in the string
Hope this helps.
Mike Wentzel
THWT Software
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [INTERFACES] Still have problem with single quotation mark
@ 1999-09-14 05:47 Andreas Theofilu <theofilu@eunet.at>
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Theofilu @ 1999-09-14 05:47 UTC (permalink / raw)
To: pgsql-interfaces
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!
-------------------------------------------------
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [INTERFACES] Still have problem with single quotation mark
@ 1999-09-14 18:24 Michael Meskes <meskes@postgreSQL.org>
parent: Theofilu Andreas <theofilu@eunet.at>
0 siblings, 0 replies; 5+ messages in thread
From: Michael Meskes @ 1999-09-14 18:24 UTC (permalink / raw)
To: Theofilu Andreas <theofilu@eunet.at>; +Cc: pgsql-interfaces
On Mon, Sep 13, 1999 at 10:11:53PM +0200, Theofilu Andreas wrote:
> 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 '
> (''). Then it would not be interpreted as the end of string. I did this and
> realy, now it is not interpreted at all. 'ecpg' puts now both quotation
> marks into the database table. This makes for example the words 'I don't
> want this' appear as 'I don''t want this'. Preceding the quotation mark
> with a backslash does not help also. Then I get the SQL error 'too many
> arguments in line xxx'. This is really annoying. How can I fix this?
Which version do you use? There was a quotation problem that should be solved in
the current version. Also how do you feed the date into the statement? As a
char variable or as a constant string?
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!
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [INTERFACES] Still have problem with single quotation mark
@ 1999-09-14 18:29 Michael Meskes <meskes@postgreSQL.org>
parent: Andreas Theofilu <theofilu@eunet.at>
0 siblings, 0 replies; 5+ messages in thread
From: Michael Meskes @ 1999-09-14 18:29 UTC (permalink / raw)
To: Andreas Theofilu <theofilu@eunet.at>; +Cc: pgsql-interfaces
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!
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~1999-09-14 18:29 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-09-13 20:11 Still have problem with single quotation mark Theofilu Andreas <theofilu@eunet.at>
1999-09-14 18:24 ` Michael Meskes <meskes@postgreSQL.org>
1999-09-13 20:26 RE: [INTERFACES] Still have problem with single quotation mark Michael Wentzel <wentzel@THWT.COM>
1999-09-14 05:47 Re: [INTERFACES] Still have problem with single quotation mark Andreas Theofilu <theofilu@eunet.at>
1999-09-14 18:29 ` Michael Meskes <meskes@postgreSQL.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox