pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: Characters that needs escape characters when inserting to database
4+ messages / 3 participants
[nested] [flat]
* Characters that needs escape characters when inserting to database
@ 2006-01-17 22:21 Christian Paul B. Cosinas <cpc@cybees.com>
2006-01-17 07:20 ` Re: Characters that needs escape characters when inserting to database Michael Glaesemann <grzm@myrealbox.com>
0 siblings, 1 reply; 4+ messages in thread
From: Christian Paul B. Cosinas @ 2006-01-17 22:21 UTC (permalink / raw)
To: pgsql-sql
Hi,
Can anyone give me a list of characters that needs to be preceded by an
escape character before inserting to database.
Aside from characters listed below what are the other characters?
"\"
"'"
Thanks
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Characters that needs escape characters when inserting to database
2006-01-17 22:21 Characters that needs escape characters when inserting to database Christian Paul B. Cosinas <cpc@cybees.com>
@ 2006-01-17 07:20 ` Michael Glaesemann <grzm@myrealbox.com>
2006-01-17 17:56 ` Re: Characters that needs escape characters when inserting to database Michael Fuhr <mike@fuhr.org>
0 siblings, 1 reply; 4+ messages in thread
From: Michael Glaesemann @ 2006-01-17 07:20 UTC (permalink / raw)
To: Christian Paul B. Cosinas <cpc@cybees.com>; +Cc: pgsql-sql
On Jan 18, 2006, at 7:21 , Christian Paul B. Cosinas wrote:
> Can anyone give me a list of characters that needs to be preceded
> by an
> escape character before inserting to database.
Take a look at this documentation on string constants. It should
answer the questions you have.
http://www.postgresql.org/docs/current/interactive/sql-
syntax.html#SQL-SYNTAX-STRINGS
Michael Glaesemann
grzm myrealbox com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Characters that needs escape characters when inserting to database
2006-01-17 22:21 Characters that needs escape characters when inserting to database Christian Paul B. Cosinas <cpc@cybees.com>
2006-01-17 07:20 ` Re: Characters that needs escape characters when inserting to database Michael Glaesemann <grzm@myrealbox.com>
@ 2006-01-17 17:56 ` Michael Fuhr <mike@fuhr.org>
2006-01-18 21:33 ` Re: Characters that needs escape characters when inserting to database Christian Paul B. Cosinas <cpc@cybees.com>
0 siblings, 1 reply; 4+ messages in thread
From: Michael Fuhr @ 2006-01-17 17:56 UTC (permalink / raw)
To: Michael Glaesemann <grzm@myrealbox.com>; +Cc: Christian Paul B. Cosinas <cpc@cybees.com>; pgsql-sql
On Tue, Jan 17, 2006 at 04:20:23PM +0900, Michael Glaesemann wrote:
> On Jan 18, 2006, at 7:21 , Christian Paul B. Cosinas wrote:
> >Can anyone give me a list of characters that needs to be preceded
> >by an escape character before inserting to database.
>
> Take a look at this documentation on string constants. It should
> answer the questions you have.
> http://www.postgresql.org/docs/current/interactive/sql-syntax.html#SQL-SYNTAX-STRINGS
Out of curiosity, why are you asking? Unless you're implementing
some low-level interface to the database you shouldn't need to worry
about escaping strings; just use your API's quote/escape (or whatever)
function or its placeholder mechanism (if it has one). If you're
using an interface that doesn't have any of these capabilities, what
is it? Some people might want to avoid it ;-)
--
Michael Fuhr
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Characters that needs escape characters when inserting to database
2006-01-17 22:21 Characters that needs escape characters when inserting to database Christian Paul B. Cosinas <cpc@cybees.com>
2006-01-17 07:20 ` Re: Characters that needs escape characters when inserting to database Michael Glaesemann <grzm@myrealbox.com>
2006-01-17 17:56 ` Re: Characters that needs escape characters when inserting to database Michael Fuhr <mike@fuhr.org>
@ 2006-01-18 21:33 ` Christian Paul B. Cosinas <cpc@cybees.com>
0 siblings, 0 replies; 4+ messages in thread
From: Christian Paul B. Cosinas @ 2006-01-18 21:33 UTC (permalink / raw)
To: 'Michael Fuhr' <mike@fuhr.org>; 'Michael Glaesemann' <grzm@myrealbox.com>; +Cc: pgsql-sql
I am using Visual Basic as the front end.
I connect to postgresql database through ODBC.
I encounter some error when I insert value to a field.
The error is "syntax error"
Which make me think that there are other characters that needs an escape
chcracter.
Cheers.
-----Original Message-----
From: Michael Fuhr [mailto:mike@fuhr.org]
Sent: Tuesday, January 17, 2006 9:57 AM
To: Michael Glaesemann
Cc: Christian Paul B. Cosinas; pgsql-sql@postgresql.org
Subject: Re: [SQL] Characters that needs escape characters when inserting to
database
On Tue, Jan 17, 2006 at 04:20:23PM +0900, Michael Glaesemann wrote:
> On Jan 18, 2006, at 7:21 , Christian Paul B. Cosinas wrote:
> >Can anyone give me a list of characters that needs to be preceded by
> >an escape character before inserting to database.
>
> Take a look at this documentation on string constants. It should
> answer the questions you have.
> http://www.postgresql.org/docs/current/interactive/sql-syntax.html#SQL
> -SYNTAX-STRINGS
Out of curiosity, why are you asking? Unless you're implementing some
low-level interface to the database you shouldn't need to worry about
escaping strings; just use your API's quote/escape (or whatever) function or
its placeholder mechanism (if it has one). If you're using an interface
that doesn't have any of these capabilities, what is it? Some people might
want to avoid it ;-)
--
Michael Fuhr
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2006-01-18 21:33 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-17 22:21 Characters that needs escape characters when inserting to database Christian Paul B. Cosinas <cpc@cybees.com>
2006-01-17 07:20 ` Michael Glaesemann <grzm@myrealbox.com>
2006-01-17 17:56 ` Michael Fuhr <mike@fuhr.org>
2006-01-18 21:33 ` Christian Paul B. Cosinas <cpc@cybees.com>
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