macromedia.coldfusion.database_access
[Top] [All Lists]

Re: MS SQL - Syntax error for valid query

Subject: Re: MS SQL - Syntax error for valid query
From: Ian Skinner <iskinner@xxxxxxxxxxx>
Date: Tue, 29 Jan 2008 12:09:28 -0800
Newsgroups: macromedia.coldfusion.database_access


AWFrueh1808 wrote:
Or let me ask it this way....

Are the single quotes escaped ONLY as part of a SQL statement? (but still, in that case, you'd think the error message wouldn't show the single quotes...yet it does....)


Generally yes. I played around with this and I see what you mean about the error message. It does not show the escaped single quote. I would presume that it is a function that doubling single quotes is also how you escape them in output strings if required.

I.E.
<cfset aVar = 'here is a single quote string with a single quote [''] in it'>

<cfoutput>#aVar#</cfoutput>

This can be very useful when one is trying to build dynamic JavaScript strings.

Noting this in the Adobe ColdFusion 'Wish' list would hopefully have the error message improved in some future version of ColdFusion.



<Prev in Thread] Current Thread [Next in Thread>