Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert quotes and apostrophes

Status
Not open for further replies.

jazzmaster111

Programmer
May 2, 2005
25
MX
Hi, how I can insert a string which contains quotes and apostrophes in an insert query???

Thanks!!
 
The usual way (for "O'Neil"):
INSERT INTO myTable (myColumn) VALUES ('O''Neil')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Another solution is to use a "unicode-string-literal",
e.g. U&'O\0027Neil', where 0027 is the hexadecimal code for "'". (But, of course, PHV's way is much easier...)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top