Hi all,
I'm having trouble using the CFFILE action="APPEND" tag. I run a query that outputs a whole heap of records which are destined to be placed into a csv file.
I create the file with the appropriate headings. This is not a problem. The problem arises when I get into the cfoutput query loop and start writing the individual lines out the the file. I even use cflock around the cffile action="APPEND" tag!
Usually, the first record writes out once. In the example below, the first record is the one saying '00185. Also in the example below, the next record (which should have been '00185A) also only gets written once. After that, I get at least two, and sometimes three (and I can't consistently reproduce this error) lines written to the file
The other odd thing is that although the query orders the records for me, they are written out of order into the file. For example I get this output even though the query has ordered it!:
'00185
'00185A11A1
'00185A11A2
'00185A
'00185A1
'00185A11A3
'00185A1AA2
'00185A11A4
'00185A1AA3
'00185A11A5
'00185A11
'00185A11A1
'00185A11A6
'00185A11A2
'00185A11A7
'00185A11A3
'00185A11A8
'00185A1AA4
'00185A1AA5
'00185A11A9
'00185A1AA6
'00185A11B1
'00185A1AA7
'00185A11B2
'00185A11A4
'00185A11A5
(The "'" is to make sure Excel realises it's looking at text, not a number)
To reiterate, these numbers should be in order, and only a single instance of them should appear. That's what the query does!
Any ideas anybody?
I'm having trouble using the CFFILE action="APPEND" tag. I run a query that outputs a whole heap of records which are destined to be placed into a csv file.
I create the file with the appropriate headings. This is not a problem. The problem arises when I get into the cfoutput query loop and start writing the individual lines out the the file. I even use cflock around the cffile action="APPEND" tag!
Usually, the first record writes out once. In the example below, the first record is the one saying '00185. Also in the example below, the next record (which should have been '00185A) also only gets written once. After that, I get at least two, and sometimes three (and I can't consistently reproduce this error) lines written to the file
The other odd thing is that although the query orders the records for me, they are written out of order into the file. For example I get this output even though the query has ordered it!:
'00185
'00185A11A1
'00185A11A2
'00185A
'00185A1
'00185A11A3
'00185A1AA2
'00185A11A4
'00185A1AA3
'00185A11A5
'00185A11
'00185A11A1
'00185A11A6
'00185A11A2
'00185A11A7
'00185A11A3
'00185A11A8
'00185A1AA4
'00185A1AA5
'00185A11A9
'00185A1AA6
'00185A11B1
'00185A1AA7
'00185A11B2
'00185A11A4
'00185A11A5
(The "'" is to make sure Excel realises it's looking at text, not a number)
To reiterate, these numbers should be in order, and only a single instance of them should appear. That's what the query does!
Any ideas anybody?