<CFQUERY NAME="qGetRegistered" datasource="#application.NPW#"> 

            SELECT 

            '"' || tbl_registration.fname || '"' || ',' || 

            '"' || tbl_registration.lname || '"' || ',' || 

            '"' || tbl_registration.address_1 || '"' || ',' ||

            '"' || tbl_registration.suite || '"' || ',' ||

            '"' || tbl_registration.city || '"' || ',' ||

            '"' || tbl_registration.state || '"' || ',' ||

            '"' || tbl_registration.zip || '"' || ',' ||

            '"' || tbl_registration.pnum || '"' || ',' ||

            '"' || tbl_registration.fax || '"' || ',' ||

            '"' || tbl_registration.email || '"' || ',' ||

            '"' || tbl_registration.ins || '"' || ',' ||

            '"' || tbl_registration.topic || '"' || ',' ||

            '"' || tbl_session.session_name || '"'  

            AS line 

            FROM tbl_registration INNER JOIN tbl_session ON

                        tbl_registration.session_name =
tbl_session.session_ID

</CFQUERY> 

<CFSET filecontent = ValueList(qGetRegistered.line,"#CHR(13)##CHR(10)#")> 

<cffile action="write" addnewline="yes" file="#application.csvpath#"
output="#filecontent#" fixnewline="no">

 

 

I'm using the above code to generate a CSV file, it works fine. How would I
add column headers to the CSV?

 

Thanks

 

sas

 

Scott Stewart

ColdFusion Developer/Administrator

GlobalNet Services, Inc.

www.gnsi.com <BLOCKED::http://www.gnsi.com/> 

301-770-9610 x358 (Voice)

301-770-9611          (Fax)

 

The information contained in this message may be privileged, confidential,
and protected from disclosure.  If the reader of this message is not the
intended recipient, or any employee or agent responsible for delivering this
message to the intended recipient, you are hereby notified that any
dissemination, distribution, or copying of this communication is strictly
prohibited.  If you have received this communication in error, please notify
us immediately by replying to the message and deleting it from your
computer.

 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:247886
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to