By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,154 Members | 2,405 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,154 IT Pros & Developers. It's quick & easy.

trouble with sql query and quotes

P: n/a
I am doing this on a table in a database.

sql query = "select all names where instr(sourcefield,searchstring) > 0"

this fails when there is embedded quotes in sourcefield such as

"the book entitled "The Sun Shines" is a book about..."

how to handle this?

thanks
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I solved this by passing sourcefield to a function that replaces the single
quote with 2 quotes.

"Danny" <da********@hotmail.com> wrote in message
news:Kw*******************@news4.srv.hcvlny.cv.net ...
I am doing this on a table in a database.

sql query = "select all names where instr(sourcefield,searchstring) > 0"

this fails when there is embedded quotes in sourcefield such as

"the book entitled "The Sun Shines" is a book about..."

how to handle this?

thanks

Nov 12 '05 #2

P: n/a
for x = 1 to infinity
print "Thank you"
next x

LOL, thanks a ton, that did it
"paii, Ron" <pa**@packairinc.com> wrote in message
news:10*************@corp.supernews.com...
I solved this by passing sourcefield to a function that replaces the single quote with 2 quotes.

"Danny" <da********@hotmail.com> wrote in message
news:Kw*******************@news4.srv.hcvlny.cv.net ...
I am doing this on a table in a database.

sql query = "select all names where instr(sourcefield,searchstring) > 0"

this fails when there is embedded quotes in sourcefield such as

"the book entitled "The Sun Shines" is a book about..."

how to handle this?

thanks


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.