• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

File Rewrite

Explorer ,
Jun 16, 2006 Jun 16, 2006

Copy link to clipboard

Copied

I want to rewrite a list of files, but I don't know how to go about doing this, I have some code that I have implemented but this code only copies one of the files and then dies when it tries to perform the query (HTTP 500 Error). So I want to rewirte as may files there can be on the directories I specified.
TOPICS
Advanced techniques

Views

557

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2006 Jun 18, 2006

Copy link to clipboard

Copied

> directory="#dirName#"
directory="#variables.dirName#", to distinguish it from form.dirName

> destination="C:\Inetpub\wwwroot\webapps\ipa_warehouse\fileformat"
destination="C:\Inetpub\wwwroot\webapps\ipa_warehouse\fileformat\", with a backslash at the end

> WHERE ACTIVITY_DATE > '1/1/2005'
WHERE ACTIVITY_DATE > #createdate(2005,1,1)#, perhaps, without the single quotes

> #dirName##dirFile#.cln
what does it point to, given that #dirName##dirFile# points to a file?

> <cffile action="write" file="#dirName##dirFile#.cln" output="foutput">
<cfoutput query="foutput">
<cffile action="append" file="#dirName##dirFile#.cln" output="#SEQ_MEMB_ID#,#ACTIVITY_DATE#,#PCP#,#Spec#,#WDW_STATE#,#WDW_FUNDING_COUNTY#,#WDW_PRODUCT#,#PLAN_CODE#,#WDW_IPA_ID#,#WDW_PCP_ID#,#WDW_INPUT_CHANNEL#,#WDW_COHORT#,#WDW_ELIG_CATEGORY#,#MASTER_DOB#,#MASTER_SEX#,#pop#,#doc#,#dob#,#age#,#sex#,#Year#">
</cfoutput>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

Thanks for replying to the thread, looking at the code you provided it does not seem that you account for the amount of files in a directory being different. These files will change at any given moment which is the reason why I was trying to do a loop and get all the files regardless of how many. This is one of my biggest issues not knowing how many. also if I remove the switch statement how would it know which directory to process.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

it does not seem that you account for the amount of files in a directory being different.
I don't understand how you got to that. It is not for me to draw conclusions about amounts of files. I have only made corrections to your existing Coldfusion and SQL code.

if I remove the switch statement how would it know which directory to process.
No one asks you to remove the switch statement.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

Oh I understand, did not realized you were just making corrections. I will apply this and see how it goes, Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

I tried running the updated code but I got an error when it tried running query portion of the code it says this:
Error Executing Database Query.

Query Of Queries syntax error.
Encountered "2005.

38 : WHERE ACTIVITY_DATE > '#CreateDate(2005,1,1)#'

I also tried running it without the quoates and instead it gives me an error:
Error casting an object of type to an incompatible type.

any ideas?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2006 Jun 19, 2006

Copy link to clipboard

Copied

LATEST
it says this:
Error Executing Database Query.


Did you do it without the quotes? That is,

WHERE ACTIVITY_DATE > #CreateDate(2005,1,1)#

If that also fails, then we should probably do

WHERE ACTIVITY_DATE > #CreateODBCDate(CreateDate(2005,1,1))#






Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation