August 17, 2004

CFMX QuotedValueList

I found out today that if you are going to use #quotedvaluelist()# in a query that you have to use it in the query and not set it as a variable before hand.

Good:

SELECT *
FROM table
WHERE something NOT IN (#quotedvaluelist(query.column)#)

Bad:

SELECT *
FROM table
WHERE something NOT IN (#varname#)

The bad example escapes the single quotes once it is used in the query. Not fun.

3 comments:

Bob H said...

thanks!

Anonymous said...

You can use the PreserveSingleQuote function to avoid having the "'" esacped.

generic cialis said...

In principle, a good happen, support the views of the author