Thanks Mark,

Worked like a charm.  Okay, another question...... I've just started to
learn about Stored Procedures, and benefits of running/referring to
queries on the SQL server level (cfstoredproc) as opposed to CF level
(referring to the query, not the stored proc)  Would there be any
benefit to setting the application var (myList) based on the stored
procedure  (the query in SQL)?  Is this even possible?  Would you notice
a performance difference? Or.. would it be best to just run query in the
application file?   

Thanks again...

Nolan



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On
Behalf Of Marc Campeau
Sent: January 30, 2002 11:35 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFTALKTor] SQL - Returning Column Names

Theres a CFQUERY return variable called COLUMN_LIST so you could do...

<CFQUERY NAME="myQry">
    SELECT [top 1] *
    FROM [your table]
</CFQUERY>

<CFLOCK>
    <CFSET APPLICATION.fieldList = myQry.COLUMN_LIST>
</CFLOCK>


Also you could fetch the column names from the System Tables of your DB
(Sysobjects in SQL server) but that will require more work..
Remember that myQry.COLUMN_LIST returns the column list sorted
alphabetically and in uppercase...

Marc Campeau
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Nolan J. Dubeau
Sent: Wednesday, January 30, 2002 11:21 AM
To: [EMAIL PROTECTED]
Subject: [CFTALKTor] SQL - Returning Column Names



Hi All,

This is part question, and part thank you.  First off, thanks to
everyone
last week for the tips on activating the SQL server db.  I eventually
got it
to verify after setting up the ODBC source with the proper username,
password permissions.

Second. Q:  (this may be basic to most)

I'm looking to run a query in my application.cfm file which will return
the
column names of a particular table in the db.
I then want to return the column name results as a comma separated list,
and
set is as an application variable.  The var will then replace the
fieldlist
below:


<CFCASE value="newListing">
<cfmodule template="display/dsp_listingForm.cfm" action="BLANK"
fieldlist="MLS,SectorCode,PropertyType,Bedrooms,Name,Address1,Address2,C
ity,
ProvinceState,PostalCode,Country,Description,Price,Image,VR,Map,Sold"></
CFCA
SE>


So, my question is.. How do I write my SQL command to list only the
column
names?

Many Thanks.

Nolan


Nolan J. Dubeau
Senior Developer (*.Maracca)
Interactive.Print.Broadcast Design

p. 416 532 8852
www.maracca.com


-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Marc Campeau" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED])
http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Nolan J. Dubeau" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to