I see others have answered you for the most part. 

As for how to see the SQL statement is (perhaps you're wondering whether the 
CFIF did
or did not evaluate), first you will see it if you do the CFDUMP folks have 
proposed
(for seeing the data), at least as long as you're in CF8 or above. Since then, 
the
CFDUMP of a query has shown as well the SQL associated with it, which is nice. 

If you're not on CF8, you can also see the SQL if you turn on debugging output 
(that
shows at the bottom of the page, if you enable it in the CF Admin). 

Third, if neither of those worked, for some reason, one trick I've used in such 
a case
(wanting to see what SQL "would have been generated" for a given dynamic query) 
is to
copy the SQL (and CFML code) out of the CFQUERY and into a CFOUTPUT that 
precedes (or
follows) the query, so that when you run it, that SQL is displayed on screen.

Finally, I don't recall if it's been mentioned yet, but there is a guide to Q 
or Q in
the CF docs: 

CF9:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0
e4fd-7ff0.html



CF8:
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=using_recordsets_7.h
tml

 

Note that this is not the CFML Reference, but rather in the Developer's Guide (a
1,000+ page document that many miss, and which would be excellent for anyone
starting-or even long-using--CF).

Hope that helps. 

 

/charlie

 

From: [email protected] [mailto:[email protected]] On Behalf Of mike barnes
Sent: Tuesday, December 07, 2010 7:38 AM
To: [email protected]
Subject: Re: [ACFUG Discuss] Noob help

 

The answer to everyones question is yes, the dbtype is "query". So, how do does 
one
debug this query of queries, since it appears to not be getting all of the 
records.
Basically, what I would like to do is see what the underlying sql statement is; 
so,
that I can map back to the database (or is this possible). Also, not sure what
debugging tools I have available to me.

 

What makes this query of queries confusing is the fact that the from statement 
does
not represent a table or view, so, what does CF use to substitute this part of 
the
query, is it all of the tables from the "main" query?

 

Thanks

Mike Barnes

 




-------------------------------------------------------------
To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to