what DB are you using?
+-----------------------------------------------+
Bryan Love
Macromedia Certified Professional
Internet Application Developer
Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+
"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
- Thomas Paine, The American Crisis
-----Original Message-----
From: BEN MORRIS [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 22, 2002 1:52 PM
To: CF-Talk
Subject: SQL: Creating a CSV in a select
A while ago Marian Dumitrascu posted the following code to create a csv file
which is very nice and clean:
<CFQUERY NAME="GetDocs"...>
SELECT
'"' + RTRIM(CATEGORY) + '"' + ',' +
'"' + RTRIM(newc2) + '"' + ',' +
...
'"' + RTRIM(C_Alias) + '"'
AS line
FROM table
</CFQUERY>
<!--- create the file content ---->
<CFSET filecontent = ValueList(GetDocs.line,"#CHR(13)##CHR(10)#")>
<!--- and save it --->
<cffile action="APPEND" file="#csvfile#" output="#filecontent#">
My problem comes in trying to do the select statement, I am finding that it
will not populate that "line" field if any of the fields used to build it
are null. Is there a way to get around this in the select statement.
Having to loop through a query takes far too much time with 7000 records,
where ValueList() is much quicker.
TIA for any help.
---------------------------------------
Ben Morris
Web Site Developer
American Federation of Government Employees, AFL-CIO
(202) 639-6448
www.afge.org
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists