What scope are the query object(s) in?
Do you mean on error just doing something like
<cfoutput>
<cfloop collection="#variables#" item="i">
<cfif isquery(variables[i])>
#i#: #variables[i].recordcount# records<br>
</cfif>
</cfloop>
</cfoutput>
That code would assume the queries existed in the variables scope and
had been run on that page. You obviously have access to any query
objects in the application scope in the same manner. If you have
queries persisted in session, then the question becomes the active
user's session or ALL sessions on the server. The sessiontracker method
in the service factory will give you everyone's sessions, but I don't
know that the performance of recursing that struct would be advisable.
If you want to see all the query objects in the variables scope for ALL
users at that instant I think you are out of luck. The contents of the
variables scope is destroyed at the end of the page load anyway so it's
not like you could get a list of "recent" queries anyway. It would have
to be recent queries whose request are still running.
~Brad
-----Original Message-----
From: Claude Schneegans [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 09, 2007 3:09 PM
To: CF-Talk
Subject: Re: Finding current queries
>>Ok, I'm still a little confused. If the query is still active then
the
result set wouldn't be defined yet.
Brad, I'm talking of CF queries objects, not SQL queries in the database
engine itself.
The SQL query may be not active, but there is still a query object
defined in the CF application.
I just want to know their names and how many records they got.
Just like in a template invoked by CFERROR, I can get le list of fields
in the FORM scope
and dump their values.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 &
Flex 2
Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280614
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4