I've created the query as a variable and use the variable inside the
cfquery:

<cfset sql = "Select * from sometable where foo = '#form.bar#' ">

Generated sql: #sql#

<cfquery name="foo" datasource="bar">
#PreserveSingleQuotes(sql)#
</cfquery>

HTH,
Tim P.
----- Original Message -----
From: "bajaria aslam" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 9:01 AM
Subject: capturing a query


> Hi List.
>
> When you have the debugging on, you can see that it
> shows the sql generated also. You may have
> #variableName# in the <cfquery> template,  but finally
> when all the variables get resolved, you have a query
> that is sent to the database.
>
> That query can be seen when the debugging is on on the
> webpage.
>
> is there a way to capture that final query?
>
> i tried #cgi.QueryName# , but did not work.
>
> Any ideas?
>
> thanks list
>
> __________________________________________________
> Do you Yahoo!?
> HotJobs - Search new jobs daily now
> http://hotjobs.yahoo.com/
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to