SQLitening Support Forum

Support Forums => You've got Questions? We've got Answers! => Topic started by: D. Wilson on January 21, 2011, 06:25:08 PM

Title: slBuildInsertOrUpdate question
Post by: D. Wilson on January 21, 2011, 06:25:08 PM
I use the slBuildInsertOrUpdate function.
The question I have is embedded single quotes. Will the slBuildInsertOrUpdate function already handle embedded single quotes or do I need to 'double' them myself.
If my understanding is correct I only need to 'double' the single quote is when I am writing my own sql statement.
Title: Re: slBuildInsertOrUpdate question
Post by: Fred Meier on January 21, 2011, 07:45:20 PM
Yes, slBuildInsertOrUpdate will handle embedded single quotes:
QuoteAlpha values will have all embedded single quotes changed to two single quotes and they will be enclosed within single quotes.  If an alpha value is already enclosed in single quotes then it will NOT be modified.
Title: Re: slBuildInsertOrUpdate question
Post by: Bern Ertl on March 26, 2014, 11:37:38 AM
Hmm.... Has anyone tested this lately?  I'm using a slBuildInsertOrUpdate call that builds the parameters using a few string variables.  One of them contained a string with an embedded single quote and it did not get escaped/doubled.  It caused the resulting SQL statement to be FUBARed.
Title: Re: slBuildInsertOrUpdate question
Post by: Bern Ertl on March 26, 2014, 12:23:11 PM
Oh heck.  Nevermind.  The problem wasn't in slBuildInsertOrUpdate.  I was calling slSelStr after my insert and I need to manually escape the single quotes in that call.