There was a response from Adam Cameron, which apparently had been removed by an excessive mod.
Instead of repeating what he says, I just copied and pasted (with emphasis on key parts):
To clarify that the syntax you tried in the first example works . This is the right approach. To clarify / explain:
The <cfquery> version of your example will look like this:
<cfqueryparam value="%foo">
So, in the version of the function, the parameter will be ? or :paramName , and the parameter value will be "%foo" .
% is part of the parameter value, not the SQL string.
So, if you do not use βdoes not work,β it will help if you post an error message or something else that makes you think that it is not working (what is your expectation and what are the actual results). Then we can deal with the actual cause of your problem, which, in my opinion, is not what you think.
Does the query work like <cfquery> ?
source share