Using a string variable as a query SQL statement
I want to construct a custom SQL statement in a string var, then use that var in the cfquery statement. What is the proper syntax? Here is my feeble attempt:
<cffunction ...>
<cfset var sql_txt="">
<cfquery name="qSBJs" datasource="cfBAA_odbc">
"#sql_txt#"
</cfquery>
<cfreturn qSBJs>
--------------------------------------------
I've tried using no " or # or just # or just " but nothing works.
what about:
<cfquery name="qSBJs" datasource="cfBAA_odbc" sql="#sql_txt#">
</cfquery>
nope. I wish there was a sql property I could fill *before* the execution of the query. Any suggestions?
