Re: Characters that needs escape characters when inserting to database

Поиск
Список
Период
Сортировка
От Christian Paul B. Cosinas
Тема Re: Characters that needs escape characters when inserting to database
Дата
Msg-id 026501c61c76$cffe3560$1e21100a@ghwk02002147
обсуждение исходный текст
Ответ на Re: Characters that needs escape characters when inserting to database  (Michael Fuhr <mike@fuhr.org>)
Список 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    



В списке pgsql-sql по дате отправления:

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Matching several rows
Следующее
От: Emil Rachovsky
Дата:
Сообщение: bug with if ... then ... clause in views