>> MS SQL Server? Profiler....

...ummm...not really - something I can embed within a CFC or cfm file.
it's the resulting SQL after any CFIF's and with the vars in place. A
bit like the debugging SQL output but with the cfqueryparam values in
the right place (and esp the delims used for diff datatypes - eg: date
Vs string)

it's more like what CFQUERY actually sends to the driver. 

Below is a really clunky way I'm doing it at the moment. it *does* give
me what I want BUT 
1) it's high maintainance (change the SQL and change the
debugging.content manually - yuck)
2) any cfqueryparams don't get parsed into it so they have to be
stripped back to plain variables

<!--- initialise the debugging in the CFC constructor --->
<cfset VARIABLES.debugging.isOn = FALSE>
<cfset VARIABLES.debugging.content = "">


<!--- just before a query  --->
<cfif VARIABLES.debugging.isOn>
        <cfsavecontent variable="localdebugging">
        <cfoutput><br>
                SELECT ADDR_NUM, AUTO_TFER, DEF_ADDR, TFER_ADDR 
                FROM pastparms WHERE cmpy_code
="#arguments.CompanyCode#"
        <br /></cfoutput>
        </cfsavecontent>
        <cfset VARIABLES.debugging.content = VARIABLES.debugging.content
& localdebugging>
        <cfset localdebugging = "">
</cfif>

and that's controlled by a couple of helper methods within the CFC, so
it can be called by 

<!--- just before you want to capeture the SQL & values --->
<cfset objReqAdmin.setDebug(TRUE)> 
<!--- call the method --->
<cfset result = objReqAdmin.DoStuff(CompanyCode="20") />

<!--- then at the bottom of the calling page --->
<cfoutput>#objReqAdmin.displayDebug()#</cfoutput>

                






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott
Thornton
Sent: Wednesday, 1 September 2004 12:00 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: capturing the executed query?

MS SQL Server?

Profiler....

>>> [EMAIL PROTECTED] 1/09/2004 11:01:54 am >>>
hi all

I seem to remember (somewhere) a way of getting the actual SQL of a
query that has been run in a variable (ie: for debugging, etc).

esp if the values are used with cfqueryparam

anyone know what I mean and can point me in the right direction?

thanx
barry.b


---
You are currently subscribed to cfaussie as:
[EMAIL PROTECTED] 
To unsubscribe send a blank email to
[EMAIL PROTECTED] 
Aussie Macromedia Developers: http://lists.daemon.com.au/

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to