I wonder if it is possible to put the output data in a query, for example i have a query:
<cfquery name="get_search_results" datasource="#dsn3#">SELECT * FROM SERVICE_GUARANTY_NEW WHERE SERIAL_NO = #get_service.PRO_SERIAL_NO#</cfquery>
and output:
<cfoutput query="get_service">#get_service.PRO_SERIAL_NO#</cfoutput>
as u can see i inserted output in a query, and it doesnt work, how do i put it in a right way? thx for help!
just in case the query of the get_service output:
<cfquery name="get_service" datasource="#dsn3#">
SELECT * FROM SERVICE WHERE SERVICE_ID = #attributes.action_id#
</cfquery>
To answer your question: you have to use cfqueryPARAM for this. If Serial_NO datatype is Varchar it will look something like this:
But I think it’s better to merge the two sql queries “get_search_result” and “get_service” into one sql:
Using subquery is faster than problematical reusing result from one query in a new query.