Unix Technical Forum

insert a value into a table

This is a discussion on insert a value into a table within the Pgsql General forums, part of the PostgreSQL category; --> i have a fiels - varchar(100) to this fiels i am trying to insert "abc\def\xyz' but it is not ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 06:34 AM
surabhi.ahuja
 
Posts: n/a
Default 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 06:34 AM
Larry Rosenman
 
Posts: n/a
Default 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
[mailtogsql-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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 06:34 AM
Michael Fuhr
 
Posts: n/a
Default 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/i...NTAX-CONSTANTS

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:48 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com