Opps, you don't need the SF for that, I didn't mean to paste that from the
code.
<cfquery name="q" datasource="myDS">
SELECT * FROM Event
</cfquery>
<cfdump var="#q.getMetaData().getColumnLabels()#">
Will work. Not sure what restrictions could cause it to fail though, so use
with caution/testing.
Ade
-----Original Message-----
From: Snake [mailto:[EMAIL PROTECTED]
Sent: 27 January 2006 18:31
To: CF-Talk
Subject: RE: Geting a list of query column names unsorted.
As long as your not on a shared host, or might get into trouble for using
the serviceFactory.
-----Original Message-----
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: 27 January 2006 18:24
To: CF-Talk
Subject: RE: Geting a list of query column names unsorted.
This'll do it:
<cfset obj = CreateObject("JAVA", "coldfusion.server.ServiceFactory")>
<cfquery name="q" datasource="myDS">
SELECT * FROM Event
</cfquery>
<cfdump var="#q.getMetaData().getColumnLabels()#">
Adrian
-----Original Message-----
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: 27 January 2006 18:02
To: CF-Talk
Subject: RE: Geting a list of query column names unsorted.
> -----Original Message-----
> From: Oleg Gunkin [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 27, 2006 12:53 PM
> To: CF-Talk
> Subject: Geting a list of query column names unsorted.
>
> 'query_name.columnlist' returns a sorted list of column names, but I
> really need it to be unsorted because for the query 'select c, a, b
> from t' I need 'c,a,b' list, NOT 'a,b,c'. How do I get an unsorted
> list of columns?
Which version of CF are you using? I coulda swore than MX+ did return the
columnnames in query order.
Jim Davis
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230615
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54