insert a value into a table

Started by surabhi.ahujaover 20 years ago3 messagesgeneral
Jump to latest
#1surabhi.ahuja
surabhi.ahuja@iiitb.ac.in

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

#2Larry Rosenman
ler@lerctr.org
In reply to: surabhi.ahuja (#1)
Re: insert a value into a table

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

#3Michael Fuhr
mike@fuhr.org
In reply to: surabhi.ahuja (#1)
Re: insert a value into a table

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