Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. cffile
      Hi, How do u code for break line when you have the output for cffile? <cffile action="append"...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139