> When a file does exist it means it hasn't yet been processed, so
> we need the information to append to the existing csv file.
> Unfortunately though the cf file append doesn't seem to be working
> and it always ends up overwriting the csv file thus wiping out the
> previous information.

I think your problem is here:

<cfif get_new_code.CurrentRow eq 1>

Your "get the right SKU" query will likely return one result for many
queries, and for each one of those it's using the "write" attribute to
write a new file whether an existing one is there or not.  You might
consider removing that block entirely, as if I remember correctly, the
"append" attribute will create the file if it doesn't exist already
and append if it does, so the functionality you're looking for is
built in anyway.  If that doesn't work, you can change that if
statement to be:

<cfif not fileExists(expandpath("/TS000102.POS"))>

That will check to see if the file exists and use "write" if it
doesn't, and "append" if it does.


-Justin

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5751
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to