Oh and to display the column name as well..
<cfoutput query="yourquery">
<cfloop list="#queryname.columnlist#" index="column"> 
#column# : #evaluate(column)#<br> 
</cfloop> 
</cfoutput>


> -----Original Message-----
> From: Snake Hollywood [mailto:[EMAIL PROTECTED] 
> Sent: 11 September 2003 01:28
> To: [EMAIL PROTECTED]
> Subject: RE: [ cf-dev ] CFQUERY - outputting a table without 
> knowing the fields in it
> 
> 
> your almost there, you us ethe columnlist to get the column 
> names, and then evaluate them to get the data.
>  
> e.g
>  
> <cfoutput query="yourquery">
> <cfloop list="#queryname.columnlist#" index="column"> 
> #evaluate(column)#<br> </cfloop> </cfoutput>
>  
> someone will pipe up and tell you not to use evaluate very 
> shortly, but i don't care :-)
>  
> Russ Michaels
> Macromedia/Allaire Certified ColdFusion Developer
>  
> Satachi Internet Development
> 
> Phone: 0870 787 3610
> Tech Support: 0906 9607800
> FAX: 0709 2212 636
>  <http://www.satachi.com/> http://www.satachi.com
> email general:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] 
> email support:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
>  
> Join our ColdFusion Developer discussion lists.
> Send an e-mail to  <mailto:[EMAIL PROTECTED]>
> [EMAIL PROTECTED]
> 
> -----Original Message-----
> From: Osullivan Karl (RKB) Senior Analyst/Programmer 
> [mailto:[EMAIL PROTECTED] 
> Sent: 10 September 2003 
> 15:53
> To: CF - Development Group
> Subject: [ cf-dev ] CFQUERY - outputting a table without 
> knowing the fields in it
> 
> 
> 
> UHCWT Logo
> 
> 
> 
> 
> Hi All.  Can anyone help me with this problem?
> 
> I'm being passed a SQL table name and a unique_id via a URL, 
> which is the table I need to query.  I return all fields 
> (SELECT *) in the table (whose structure I do not know), 
> where the EntryId (which is always a field in the table) 
> equals the unique_id.
> 
> I then want to display the data, along with the field names 
> from the table.  However, the CFQUERY.columnlist shows all 
> the fields in alphabetical order.  Is there another way to 
> get the field names and data displayed (eg loading it into a 
> structure or something?)
> 
> Thanks
> 
> 
> Karl O'Sullivan
> Senior Analyst/Programmer
> 
> Computer & Network Services
> UHCW NHS Trust
> Clifford Bridge Road
> COVENTRY
> CV2 2DX
> 
> Contact:
> Tel (internal): 28952
> Tel (external): +44 (0) 24 7696 8952
> Email: [EMAIL PROTECTED]
> Web: www.uhcw.nhs.uk 
> 
>  
> 
>  
> 
> 



-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to