Good morning!
This is not a critical issue - I have the function working using CFFILE's append method. I'm mainly interested in learning the right way to do this sort of thing for the future.
When I was Googling information on using CFFILE, I came across a 2007 blog entry from Ben Nadel that showed a more efficient way to build the CSV and I wanted to try it out.
When I attempt to use a stringBuffer created object (tostring) as the CFFILE output, Lucee returns "Can't cast Complex Object Type Query to String, Use Built-In-Function "serialize(Query):String" to create a String from Query"
It returns this message even when using serialize.
The object works as expected when dumping or writing to cfoutput.
My environment is:
Test server running Lucee 4.5.1.023 on Windows Server 2012 R2, IIS 8
Also, I have AFC 10 and 11, both running on Server 2012 R2, at the day job and usually cross-test there.
I've attached two files.
1) sbuffer.cfm is from my AFC servers and shows that the basic functionality works there - I know that compatability varies by function, just showing how it works.
2) javapickSchool.cfm is from Lucee. I've included a copy of the query functions I call from the CFC, a few remarks about what the code is doing, and I've also commented out variations that did not work.
Please keep in mind that I'm an experienced tester but a novice programmer, so if I'm doing something stupid, you'll help me a lot by pointing it out.
Also, let me know if you need any more information!