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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do a Query Dump?

Status
Not open for further replies.

JohnBeals

Programmer
Feb 26, 2002
49
US
I occasionally query a data source and just want to see the query results. Is there a way to do a query dump without having to create a structures html page and doing a cfoutput? I want to dump this in a .cfm page, not use SQL Query Analyzer or Enterprise Manager.
TIA
John
 
Try using cfdump --

<cfquery name-&quot;foo&quot; datasource=&quot;bar&quot;>
Select * from mytable
</cfquery>

<cfdump var=&quot;#foo#&quot;>

 
Oh, one other thing about cfdump -- it is only good on version 5 or higher.

for prior versions, you can do this:

<cfquery name=&quot;foo&quot; datasource=&quot;logger&quot; maxrows=&quot;50&quot;>
Select * from mytable

</cfquery>
<cfset numRecs = foo.recordcount>
<cfset colList = foo.columnList>
<cfloop from=&quot;1&quot; to=&quot;#numRecs#&quot; index=&quot;i&quot;>
<cfloop list=&quot;#colList#&quot; index=&quot;idx&quot;>
<cfoutput>#foo[idx]#<br></cfoutput>
</cfloop>
</cfloop>


HTH,
Tim P.
 
Thank you so much. I have CF 5, and cfdump worked perfectly.
JB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top