Home » SQL & PL/SQL » SQL & PL/SQL » insert Problem
insert Problem [message #19609] Mon, 01 April 2002 10:49 Go to next message
maw855
Messages: 2
Registered: April 2002
Junior Member
I am trying to automate the export of data from SQL server 7 by generating insert into statements.

Some of my text fields contain apostrophes that i.e.
'This dinner is from Ted's Diner'.

My insert statements have single quotes for the text fields so SQL server gets confused with the extra quote. Is there a way to escape the ' in Ted's so that SQL would read it correctly?
Re: insert Problem [message #19615 is a reply to message #19609] Mon, 01 April 2002 19:07 Go to previous messageGo to next message
Nilesh Mahajan
Messages: 10
Registered: March 2002
Junior Member
You just replace '(Single quote) with ''(Double quote) and It will work.
Re: insert Problem [message #19617 is a reply to message #19609] Mon, 01 April 2002 19:10 Go to previous messageGo to next message
Nilesh Mahajan
Messages: 10
Registered: March 2002
Junior Member
I mean to say instead of putting one double quote use two single quotes like ''
Re: insert Problem [message #19633 is a reply to message #19609] Tue, 02 April 2002 01:13 Go to previous message
maw855
Messages: 2
Registered: April 2002
Junior Member
Thanks, I was aware I could use double quotes, but
if I do and the text has double quotes in it, don't
the same problem?

Mary said "This dinner is from Ted's diner."

I guess the answer then is that there is no way to
escape characters within sql insert statement?
Previous Topic: Oracle Little problem
Next Topic: updating a particular value in a record.
Goto Forum:
  


Current Time: Thu Apr 25 12:20:46 CDT 2024