There's a few things you can do...

1) enable debugging, then check your [..]\WEB-INF\debug\ folder for
insight into the cfdebug structure. I think you can probably just
<cfdump var="#cfdebug_queries#"> to get a visualization, then use that
to get at all the variables you want.

2) rewrite your sql statements using cfsavecontent:
<cfquery ...>
    <cfsavecontent var="q">
       select * from foo
    </cfsavecontent>
    #preserveSingleQuotes(q)#
</cfquery>
then save Q to an array or something

3) rewrite your queries using a cffunction, basically like:

<cffunction name="cfquery">
   <cfargument name="sql">
   <cfset var q = "">
   <cfquery name="q" ...>#preserveSingleQuotes(arguments.sql)#</cfquery>
   <cfreturn q>
   <!--- save q to an array right here, then mail yourself the array
later --->
</cffunction>

<cfset myQueryResults = cfquery("select * from foo")>

hth
-nathan strutz
http://www.dopefly.com/

Ciliotta, Mario wrote:

> Hi,
>
>
> Is there anyway to get the text of the query that is being executed.  I
> have a
> page that the query is being pieced together thru the use of dropdowns
> and so
> on and the problem that I am having is that certain query will return a
> large
> amount of records (@50,000) and I want to capture every query that is
> run and
> have it emailed to me so that I can see what the queries are and speak to my
> DBA department to see exactly what has happened to those tables.  
>
>
> I checked the logs and the page is logged as running longer that the set
> time
> in tha admin but the page will finally finish.  I know that there is
> #error.querystring#, but is there anyway to get the query string if there is
> no error.
>
>
> Thanks
> Mario
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to