Took a wild guess that it might need to be currentrow instead of
currentrecord.  Seems to be running now.  THX.

-----Original Message-----
From: Gieseman, Athelene [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 29, 2002 10:32 AM
To: CF-Talk
Subject: RE: Creating a CSV File

I'm using a stored procedure which puts the results into GetDocs.  I'm
getting an error on:  getdocs.currentrecord   It says it's not a valid
column.  Do I somehow need to setup something to determine the current
record?  Or is it not providing that since it's coming from a stored
procedure?  

Athelene

-----Original Message-----
From: Matthew R. Small [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 29, 2002 10:06 AM
To: CF-Talk
Subject: RE: Creating a CSV File

Sorry, I forgot a couple of things ...


<cfset
csvfile="//kcweb/firmdaily/isweb/hbimport/"&#rtrim(GetAuthors.AUTHOR)#&"
_FIR
ST.csv">

<cfset theoutput = "">

<cfoutput query="GetDocs">

<cfset theoutput = theoutput &
"#chr(34)##rtrim(GetDocs.DOCNUM)##chr(34)#,#chr(34)##rtrim(GetDocs.VE
RSION)##chr(34)#,#chr(34)##rtrim(GetDocs.FULLPATH)##chr(34)#,#chr(34)##r
trim
(GetDocs.DEPT)##chr(34)#,#chr(34)##rtrim(GetDocs.CATEGORY)##chr(34)#,#ch
r(34
)##rtrim(GetDocs.newc1)##chr(34)#,#chr(34)##rtrim(GetDocs.newc2)##chr(34
)#,#
chr(34)##rtrim(GetDocs.operator)##chr(34)#,#chr(34)##rtrim(GetDocs.editd
ate)
##chr(34)#,#chr(34)##rtrim(GetDocs.edittime)##chr(34)#,#chr(34)##rtrim(G
etDo
cs.author)##chr(34)#,#chr(34)##rtrim(GetDocs.createdate)##chr(34)#,#chr(
34)#
#rtrim(GetDocs.createtime)##chr(34)#,#rtrim(GetDocs.docname)#,#chr(34)##
rtri
m(GetDocs.comments)##chr(34)#,#chr(34)##rtrim(GetDocs.T_Alias)##chr(34)#
,#ch
r(34)##rtrim(GetDocs.C_Alias)##chr(34)#">

<cfif getdocs.currentrecord mod 100000 eq 0>
        <cffile ... output = theoutput >
        <cfset theoutput = "">
</cfif>

</cfoutput>-----Original Message-----
From: Matthew R. Small [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 29, 2002 11:02 AM
To: CF-Talk
Subject: RE: Creating a CSV File

Store your information in a variable until you reach a certain number of
records and then append it to the file.  You will have a significantly
reduced number of writes to the disk which is causing your slow
response.


Something like this:

<cfset
csvfile="//kcweb/firmdaily/isweb/hbimport/"&#rtrim(GetAuthors.AUTHOR)#&"
_FIR
ST.csv">

<cfoutput query="GetDocs">

<cfset theoutput =
"#chr(34)##rtrim(GetDocs.DOCNUM)##chr(34)#,#chr(34)##rtrim(GetDocs.VE
RSION)##chr(34)#,#chr(34)##rtrim(GetDocs.FULLPATH)##chr(34)#,#chr(34)##r
trim
(GetDocs.DEPT)##chr(34)#,#chr(34)##rtrim(GetDocs.CATEGORY)##chr(34)#,#ch
r(34
)##rtrim(GetDocs.newc1)##chr(34)#,#chr(34)##rtrim(GetDocs.newc2)##chr(34
)#,#
chr(34)##rtrim(GetDocs.operator)##chr(34)#,#chr(34)##rtrim(GetDocs.editd
ate)
##chr(34)#,#chr(34)##rtrim(GetDocs.edittime)##chr(34)#,#chr(34)##rtrim(G
etDo
cs.author)##chr(34)#,#chr(34)##rtrim(GetDocs.createdate)##chr(34)#,#chr(
34)#
#rtrim(GetDocs.createtime)##chr(34)#,#rtrim(GetDocs.docname)#,#chr(34)##
rtri
m(GetDocs.comments)##chr(34)#,#chr(34)##rtrim(GetDocs.T_Alias)##chr(34)#
,#ch
r(34)##rtrim(GetDocs.C_Alias)##chr(34)#">

<cfif getdocs.currentrecord mod 100000 eq 0>
        <cffile ... output = theoutput >
</cfif>

</cfoutput>

- Matt Small





-----Original Message-----
From: Gieseman, Athelene [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 29, 2002 10:31 AM
To: CF-Talk
Subject: Creating a CSV File

I have created a CF page which uses CFFILE to read data from a table and
create a .csv file from that data.  It works.  The problem is that it is
very slow.  Is there anything I can do to create this file without
having to
open, append and close the file for each line?  Or is there some other
reason it is taking so long?  I'll have about a half a million records
for
all the various csv's I need to create next week.  Any suggestions would
be
very much appreciated!

The code is as follows:

<cfset
csvfile="//kcweb/firmdaily/isweb/hbimport/"&#rtrim(GetAuthors.AUTHOR)#&"
_FIR
ST.csv">

<cfoutput query="GetDocs">
<cffile action="APPEND" file=#csvfile#
output="#chr(34)##rtrim(GetDocs.DOCNUM)##chr(34)#,#chr(34)##rtrim(GetDoc
s.VE
RSION)##chr(34)#,#chr(34)##rtrim(GetDocs.FULLPATH)##chr(34)#,#chr(34)##r
trim
(GetDocs.DEPT)##chr(34)#,#chr(34)##rtrim(GetDocs.CATEGORY)##chr(34)#,#ch
r(34
)##rtrim(GetDocs.newc1)##chr(34)#,#chr(34)##rtrim(GetDocs.newc2)##chr(34
)#,#
chr(34)##rtrim(GetDocs.operator)##chr(34)#,#chr(34)##rtrim(GetDocs.editd
ate)
##chr(34)#,#chr(34)##rtrim(GetDocs.edittime)##chr(34)#,#chr(34)##rtrim(G
etDo
cs.author)##chr(34)#,#chr(34)##rtrim(GetDocs.createdate)##chr(34)#,#chr(
34)#
#rtrim(GetDocs.createtime)##chr(34)#,#rtrim(GetDocs.docname)#,#chr(34)##
rtri
m(GetDocs.comments)##chr(34)#,#chr(34)##rtrim(GetDocs.T_Alias)##chr(34)#
,#ch
r(34)##rtrim(GetDocs.C_Alias)##chr(34)#" addnewline="Yes">

</cfoutput>

 





______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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

Reply via email to