Thread: insert a value into a table

insert a value into a table

From
"surabhi.ahuja"
Date:
 i have a fiels - varchar(100)
 
to this fiels i am trying to insert
 
"abc\def\xyz'
 
but it is not inserting the whole thing ...
 
how can i ensure that the whole string including the backslashes get inserted into the table
 
thanks
regards
surabhi

Re: insert a value into a table

From
"Larry Rosenman"
Date:
double the backslashes.  They are an escape character.
 
 

--
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 3535 Gaspar Drive, Dallas, TX 75220-3611 US

 


From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of surabhi.ahuja
Sent: Friday, October 21, 2005 10:00 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] insert a value into a table

 i have a fiels - varchar(100)
 
to this fiels i am trying to insert
 
"abc\def\xyz'
 
but it is not inserting the whole thing ...
 
how can i ensure that the whole string including the backslashes get inserted into the table
 
thanks
regards
surabhi

Re: insert a value into a table

From
Michael Fuhr
Date:
On Fri, Oct 21, 2005 at 08:29:44PM +0530, surabhi.ahuja wrote:
>  i have a fiels - varchar(100)
>
> to this fiels i am trying to insert
>
> "abc\def\xyz'
>
> but it is not inserting the whole thing ...

See "String Constants" in the documentation and take particular
note of what it says regarding backslashes:

http://www.postgresql.org/docs/8.0/interactive/sql-syntax.html#SQL-SYNTAX-CONSTANTS

--
Michael Fuhr