What version of CF are you using? In 7, there is the new RESULT attribute
allowing you to name a variable which is a structure, and one of its keys is
SQL and another is sqlparameters:

<CFQUERY NAME="demoq" DATASOURCE="cfdocexamples" result="test">
        select * from employees
        where lastname = <cfqueryparam cfsqltype="CF_SQL_VARCHAR"
value="smith">
</CFQUERY>

<cfdump var="#demoq#">
<cfdump var="#test#">

that returns:
 
query - Top 2 of 2 Rows 
         DEPARTMENT      EMAIL   EMP_ID  FIRSTNAME       IM_ID   LASTNAME
LOCATION         PHONE  
1        Accounting     ASMITH  4       Aaron   [EMAIL PROTECTED]       Smith   
San
Francisco       (612) 832-7201  
2        Administration         JSMITH  9       Jenna   [EMAIL PROTECTED]
Smith   San Diego       (612) 832-7422  
struct  
CACHED   false  
COLUMNLIST
DEPARTMENT,EMAIL,EMP_ID,FIRSTNAME,IM_ID,LASTNAME,LOCATION,PHONE         
EXECUTIONTIME    250    
RECORDCOUNT      2      
SQL      select * from employees where lastname = ?     
SQLPARAMETERS    
array   
1        smith  
 
If you're using an older release, I seem to recall some undocumented
functions, accessing the debug info I think, or perhaps accessing the
underlying query result set object, that may help. But in case you're at 7,
check out the above which is fully supported.


/Charlie
http://www.carehart.org/blog/ 

-----Original Message-----
From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Scott Thornton
Sent: Tuesday, February 20, 2007 5:52 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Query Parameter List in the Error Structure


Hi,

I use a site wide error template that emails the text of the query that
caused a problem.

When the query uses cfqueryparam tags the parameters passed are in the form
(param 1) etc in the text of the query.

Is it possible to find out what these params are?

To get the SQL I use:
error.rootCause.SQL

If I try to dump error.rootCause to take a look what is inside I get
[Unknown Type] displayed.

Any ideas?





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to