I'm trying to do the following:
...prior query name='earlier_query'
...
<cfset mylist=QuotedValueList(earlier_query.column)>
<cfquery datasource="something" name="new_query">
SELECT column1, column2
FROM table
WHERE column2 in ('#mylist#')
</cfquery>
<cfoutput>
RecordCount: #new_query.RecordCount#
</cfoutput>
However, I'm not getting any results because the ColdFusion server is interpreting ('#mylist#') as a single element in the list:
(''item1', 'item2', 'item3'')
where the single item is: " 'item1','item2','item3' "
So, if I try to change the line to:
WHERE column2 IN (#mylist#)
then I get errors: "Syntax error (missing operator) in query expression "
So how do I escape these *!@#$%!* quotes?
Sorry for the slang, but I'm really getting angry.
Thanks for any help!
...prior query name='earlier_query'
...
<cfset mylist=QuotedValueList(earlier_query.column)>
<cfquery datasource="something" name="new_query">
SELECT column1, column2
FROM table
WHERE column2 in ('#mylist#')
</cfquery>
<cfoutput>
RecordCount: #new_query.RecordCount#
</cfoutput>
However, I'm not getting any results because the ColdFusion server is interpreting ('#mylist#') as a single element in the list:
(''item1', 'item2', 'item3'')
where the single item is: " 'item1','item2','item3' "
So, if I try to change the line to:
WHERE column2 IN (#mylist#)
then I get errors: "Syntax error (missing operator) in query expression "
So how do I escape these *!@#$%!* quotes?
Sorry for the slang, but I'm really getting angry.
Thanks for any help!