Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfdump cfquery

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
Hi guys I thought you could cfdump a query as shown on but I am getting errors when I try this. I am getting queryName is undefined. But the query IS defined, I can see the query and its results on the bottom of the debug page.

I am using CF7.

Any thoughts?

Thanks.

____________________________________
Just Imagine.
 
What Syntax are you using GUJU? I think perhaps your trying to define a query attribute to your dump tag, when you need to assign a 'var' attribute, at least thats how i have mine running.

Code:
<cfquery name="qTest" datasource="myDsn"> 
SELECT * FROM table
</cfquery>
 
<cfdump var="#qTest#">

Hope that helps,

Rob
 
Hey Rob, i'm calling it the same way:

Code:
<cfdump var="#myQuery#" label="CFCATCH: QUERY myQuery">

I even tried it without the "label" attribute, still no luck.

My error keeps coming back as the queryname being undefined.

____________________________________
Just Imagine.
 
FALCONSEYE, I want to display the dump of the query. In other words, I wrap all my queries in a <cftry><cfcatch> tags. If my query fails, I want to email myself a dump of the query.

____________________________________
Just Imagine.
 
Very strange GUJU,

I cant understand why the dump isnt working. If you are runing the code as it is above then you shouldn't have any issues ... i've been running that code on my MX7 account without any beef atall.

I'm not sure what method you're using for your error handling, but there is some good stuff on easycfm.com on methods for having you app mail you on error.

If anything else crosses my mind i'll let you know.

Rob

 
well, if there is an error with the query, your cfdump will not work since the <cfquery name="qTest" ... > won't be defined.

you may try to email the error message itself.

cfcatch variable
Content

cfcatch.type

Type: Exception type, as specified in cfcatch.

cfcatch.message

Message: Exception's diagnostic message, if provided; otherwise, an empty string; in the cfcatch.message variable

cfcatch.detail

Detailed message from the CFML interpreter or specified in a cfthrow tag. When the exception is generated by ColdFusion (and not cfthrow), the message can contain HTML formatting and can help determine which tag threw the exception.

cfcatch.tagcontext

An array of tag context structures, each representing one level of the active tag context at the time of the exception.

cfcatch.NativeErrorCode

Applies to type = "database". Native error code associated with exception. Database drivers typically provide error codes to diagnose failing database operations. Default: -1.

cfcatch.SQLState

Applies to type ="database". SQLState associated with exception. Database drivers typically provide error codes to help diagnose failing database operations. Default: -1.

cfcatch.Sql

Applies to type ="database". The SQL statement sent to the data source.

cfcatch.queryError

Applies to type ="database". The error message as reported by the database driver.

cfcatch.where

Applies to type ="database". If the query uses the cfqueryparam tag, query parameter name-value pairs.

cfcatch.ErrNumber

Applies to type="expression". Internal expression error number.

cfcatch.MissingFileName

Applies to type="missingInclude". Name of file that could not be included.

cfcatch.LockName

Applies to type="lock". Name of affected lock (if the lock is unnamed, the value is "anonymous").

cfcatch.LockOperation

Applies to type="lock". Operation that failed (Timeout, Create Mutex, or Unknown).

cfcatch.ErrorCode

Applies to type="custom". String error code.

cfcatch.ExtendedInfo


hope it helps...



 
FALCONSEYE, thanks. I think that's why I am getting that error.

imstillatwork, yeah that's what I am looking for. What I want is a simple way to email myself all queries on the page within the <cftry><cfcatch> tags. I already cfdump the #cfcatch# var but would also like the queries.

And, yes I know I can easily copy/paste the queries in the cfmail tag, but then if i make a change on the actual query, i'd have to update the copy/paste version as well, make sense?

Any thoughts?

____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top