Storing Too Much in ColdFusion Variables – My Lesson Learned
As part of a recent a ColdFusion project, I needed to query an Oracle database and accept anywhere from 0 to 30k-40k records, then export into a CSV. It didn’t seem like too difficult of a problem at first. I used Toad to build the perfect query. Once optimized to pull down the max amount of records in the least amount of time, I copied to ColdFusion, built my front end, tested, and released. How’d I do it? Seemed simple — I setup a variable with a CSV header row, and then appended the variable record by record with the new data, and at the end CFFILE’d it all into a temp file which I then presented to the user.
