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

count number of columns in a table 1

Status
Not open for further replies.

joelxez

Programmer
Apr 18, 2002
67
PH
hi experts,

any tips on how to count number of columns in a table?

j
 
Code:
<cfquery name="query_name">
SELECT *
FROM Whatever
</cfquery>

<cfoutput>
   #ListLen(query_name.columnList)#
</cfoutput>
If you didn't want any results from your query (you were only going to use it for the column count), you could use this:
Code:
<cfquery name="query_name">
SELECT *
FROM Whatever
WHERE 0 = 1
</cfquery>



Hope This Helps!

Ecobb

&quot;My work is a game, a very serious game.&quot; - M.C. Escher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top