However, do NOT do that for very large (50,000+ records) reports. Write
each line at a time. It may be counter-intuitive, but apparently,
appending data to a variables takes exponentially longer as the variable
grows bigger...

> don't do a CFFILE ACTION="append", that'll be slow like nothing else.  Build
> the entire file in memory, and then write it with a single CFFILE.  If your
> memory won't handle it, then break it down into chunks (maybe a few hundred
> or a thousand records each), and write those chunks to the file, rather than
> each record.
>
> ---
> Barney Boisvert, Senior Development Engineer
> AudienceCentral (formerly PIER System, Inc.)
> [EMAIL PROTECTED]
> voice : 360.756.8080 x12
> fax   : 360.647.5351
>
> www.audiencecentral.com
>
> > -----Original Message-----
> > From: Costas Piliotis [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, June 05, 2003 11:47 AM
> > To: CF-Talk
> > Subject: RE: csv files
> >
> >
> > Here.  Convert query and filename as you like:
> >
> > <cfquery datasource="#application.ds#" name="test">
> > select branchid, branchname from tblbranches
> > </cfquery>
> >
> > <cfoutput query="test">
> >     <cfset myvar = "">
> >     <cfloop list="#test.columnlist#" index="mycol">
> >             <cfset myvar = myvar &", "& evaluate("test." & mycol)>
> >     </cfloop>
> >     <cfset myvar = right(myvar, len(myvar) - 1)>
> >     <cffile action="APPEND" file="\\yvrworptest\worp\test.csv"
> > output="#myvar#">
> > </cfoutput>
> >
> > -----Original Message-----
> > From: Michael Tangorre [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, June 05, 2003 11:31 AM
> > To: CF-Talk
> > Subject: csv files
> >
> >
> > Shoot me dead if this has been asked and answered, but pelase respond
> > nonetheless so that my replacement can jump right in:
> >
> > what is the easiest way to create a csv file from a query? What I
> > have is a
> > custom tag that takes a runs a query and need to genenrate a csv file and
> > then save it to the server using cffile.
> >
> >
> > TIA,
> >
> > Mike
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to