> Insert Into table(userID,FirstName,LastName) values(1,'''\''','test')
I don't know if you have been able to figure out yet what you need but think of it
this way: 'Nick' is a quoted word. let's form the possesive (nick's) 'Nick\'s' notice you still have the
outsidequotes. The slash is telling the system
to ignore the single quote that directly follows it.
so what you want is:
INSERT INTO table (userID, FirstName, LastName) VALUES (1, 'william', 'L\'sale')
if you intend to have a single quote in the middle of a string (L'sale)
Ted
-----Original Message-----
From: "Megalex" <megalex@klanomega.com>
To: <pgsql-sql@postgresql.org>
Date: Thu, 4 Jan 2001 12:57:19 -0600
Subject: [SQL] problems with single quotes..
> ok.. here is my deal..
>
> everytime i try to run an insert and my text contains '\'
> it fails..
>
> an sql example would be.
>
> Insert Into table(userID,FirstName,LastName) values(1,'''\''','test')
> and i get this message...
>
> Error while executing the query; ERROR: parser: parse error at or near
> "test"
>
> how can i fix this??
>
> Alex,