aspsue
asked on
How can I write a CF query to a Text file?
Instead of writing my query to a table, I want to write it to a text file.
Can someone help me with the code/syntax?
Sue
Can someone help me with the code/syntax?
Sue
output="<cfouptput query="yourquery">cfset var= #var#+ #field1#,#field2#,#field3# \n \\ not sure about the "\n" might need to be ascii char for newline <\cfoutput>" \\all in one line
should be
output="<cfouptput query="yourquery">#field1# ,#field2#, #field3#\n <\cfoutput>" \\all in one line
should be
output="<cfouptput query="yourquery">#field1#
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<cfset var="">
<cfouptput query="yourquery">
cfset var= #var#+ #field1#,#field2#,#field3#
<\cfoutput>
and then use
<cffile action="write" file="path/to/file.txt" output="#var#" addnewline="no">
or you might be able to output the query within the cffile tag
output="<cfouptput query="yourquery">cfset var= #var#+ #field1#,#field2#,#field3#