Question
cfqueryparam in cfset
I do a lot of things like like:
<cfset selectStatement="select id, someText, someValue from myTable ">
<cfset whereStatement= " where id=#form.getId# ">
Then
<cfquery...>
#selectStatement# #whereStatement#
</cfquery>
But I can't use the cfqueryparam tag in the cfset tag. It busts. I can't do :
<cfset whereStatement= "where id = <cfqueryparam value="#form.id#" cfsqltype="CF_SQL_NUMERIC"> ">
What's a good work around for me. I want to prevent sql injection attacks, but I create my sql as variables outside the cfquery tag.
Thanks,
Bagus