Thread: insert with "Fred's car!"

insert with "Fred's car!"

From
"Frederic boucher"
Date:
Hi,

A simple question :

How can I insert a values like

insert into tablename values('Fred's car');

I've tried "Fred's car", 'Fred''s car', etc but nothing work.. is there a 
"\something" to pass it like

'Fred\c' car'

?

THanks
\fb

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Re: [SQL] insert with "Fred's car!"

From
Bruce Momjian
Date:
> Hi,
> 
> A simple question :
> 
> How can I insert a values like
> 
> insert into tablename values('Fred's car');
> 
> I've tried "Fred's car", 'Fred''s car', etc but nothing work.. is there a 
> "\something" to pass it like

Should work.

test=> create table test (x text);CREATEtest=> insert into test values ('asdf''fred');INSERT 18569 1test=> select *
fromtest;     x     ----------- asdf'fred(1 row)
 


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026