This content has been marked as final. Show 5 replies
cfqueryparam list ="yes" works.
Another way is to quote all your quotes with the replace function.
You could also use
cfquery is doubling my single quotes. I can't seem to find any
documentation on when or why it does this.
It does this to properly handle strings with single quotes|apostrophes
<aString = "Bob's your uncle">
INSERT INTO aTable
If the single quote in the string was not escaped by doubling, this
query would fail. As mentioned the preserveSingleQuotes() function is
used when you want to suppress this behavior.
though, if it works in the context of your code, Dan Bracuk's first suggestion is probably the best:
<!--- notice no single quotes --->
Where f1 in(<cfqueryparam cfsqltype="CF_SQL_VARCHAR" list="yes" value="#strList#">)
CFQueryParam will not only qualify each item with single quotes (if list="Yes"), but it will also help CF optimize your query and it might help speed things up.
I've read through this discussion
but still have problem with the codes below:
<cfquery name="UPDATE_RCUS_TYPE_1" datasource="#application.unify01_i#">
SET RULE_VALUE = 1
WHERE RULE_NAME = #PreserveSingleQuotes(sqlstring)#;
they simply don't work.
am I doing wrong with anything?