Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Prabhakar99 #1
USING CFFILE
I am appending data from query to text file.The number of records appended
approximately are about 35000 records.I wrote the code in the format given
below. The text file gets created but it does not display the html code given
below and just hangs.I tried different possible ways but I was not
successful.Can anyone please help me out to solve the problem?
<cfsetting enableCFoutputOnly="No" showDebugOutput ="No" requestTimeOut ="600">
<cfquery name="getRootFolder" datasource="#ShareCareDataSource#">
select GlobalVarchar
from GlobalVar
where UPPER(GlobalNme) = UPPER('RepositoryFolder')
</cfquery>
<cfset rootfolder = "#getRootFolder.Globalvarchar#">
<cfset baseoutputpath = "#rootFolder#">
<cfif baseoutputpath eq "">
<cflocation url="MedicaidSSN_Sel.cfm?message=1">
<cfabort>
</cfif>
<cfset outputdir = "#BaseOutputPath#Structure_0\">
<cfif not directoryexists(outputdir)>
<cfdirectory directory="#OutPutDir#" action="create">
</cfif>
<cfset outputdir = "#BaseOutputPath#Structure_0\COR\">
<cfif not directoryexists(outputdir)>
<cfdirectory directory="#OutPutDir#" action="create">
</cfif>
<cfset grouptype="SSN" & dateformat(currentsharecaredatetime, "YYYYMMDD")>
<cfset savepath = "#OutPutDir#" & #grouptype# & ".txt">
<cfif FileExists(savepath)>
<cffile action="delete" file="#savepath#">
</cfif>
<cfstoredproc procedure = "FI28_Medicaid_Non_Match_SSN" datasource =
"#ShareCareDataSource#">
</cfstoredproc>
<cfquery name="GetData" datasource="#sharecaredatasource#">
SELECT recdetl FROM TMP_FI28MEDICAIDNONSSN ORDER BY NUMSEQ
</cfquery>
<cfoutput>
<cfloop query="GetData">
<cffile action="append" file="#savepath#" output="#ucase(getdata.recdetl)#"
addnewline="yes">
</cfloop>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<br>
<div align="center">
<b>The following text files currently exist in <font
color="800000">#rootFolder#Structure_0\COR\</font>.</b>
</div>
<input type="button" name="Back" value="Close" class="buttonbar"
onclick="javascript:document.location='MedicaidSSN _Sel.cfm'">
</body>
</html>
</cfoutput>
</cfsetting>
Prabhakar99 Guest
-
cffile
Hi, How do u code for break line when you have the output for cffile? <cffile action="append"... -
need help with cffile
I am having some trouble with cffile - i am trying to uplaoad a few files in a form and rename them to be inserted into the database - the problem... -
CFFILE on PC and Mac
So I've been looking at the suggested solution mentioned by Fug. It looks like it might work, but it is 400+ lines of code and will take a bit of... -
Need Help With CFFILE Please
Good morning. I was able to output my query to a text file without any problems. Now I have to adjust the results by formatting it to specific... -
CFFILE Help please
etman, The "permission denied" is all you need to know - you can't write the file where you are trying to write it. Contact your hosting... -
JMGibson3 #2
Re: USING CFFILE
"file gets created", no doubt. All records written, perhaps not. You said
"hangs". Does it crash your server? Anything in application/server logs
indicating time-outs? At any rate APPENDS can be notoriously inefficient, see
thread below. I'd look there first. Good Luck.
[url]http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=6&thread[/url]
id=1002185
JMGibson3 Guest



Reply With Quote

