I am working in Cold fusion and Access. I have a list storing countrycodes like AU,NZ etc. I store it in attributes.cntrylist I listqualify this varibale so as to make it like 'AU','NZ' Then run a query like this:
<cfparam name="attributes.cntrylist" default="">
<cfset cntrylist = listqualify (attributes.cntrylist,"'",",",'ALL')>
<cfquery name="getCountry" datasource="getCountry">
SELECT country,code
FROM CountryCodes
WHERE code in (#attributes.cntrylist#)
ORDER BY Country
</cfquery>
This query doesn't work as in error message it displays
SELECT country,code FROM CountryCodes WHERE code in (''AU'',''NZ'') ORDER BY Country
but when I output the variable attributes.cntrylist, it shows 'AU','NZ'.
I don't know why single quotes are being converted to double quotes in query.
Any help is appreciated. Thanks...
<cfparam name="attributes.cntrylist" default="">
<cfset cntrylist = listqualify (attributes.cntrylist,"'",",",'ALL')>
<cfquery name="getCountry" datasource="getCountry">
SELECT country,code
FROM CountryCodes
WHERE code in (#attributes.cntrylist#)
ORDER BY Country
</cfquery>
This query doesn't work as in error message it displays
SELECT country,code FROM CountryCodes WHERE code in (''AU'',''NZ'') ORDER BY Country
but when I output the variable attributes.cntrylist, it shows 'AU','NZ'.
I don't know why single quotes are being converted to double quotes in query.
Any help is appreciated. Thanks...