Skip to content

Instantly share code, notes, and snippets.

@JamoCA
Last active May 24, 2023 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamoCA/19dd449408fbec923f7c21a173a0f0dc to your computer and use it in GitHub Desktop.
Save JamoCA/19dd449408fbec923f7c21a173a0f0dc to your computer and use it in GitHub Desktop.
Short, Self Contained, Correct (Compilable), Example (SSCCE) of ColdFusion Bug CF-4212034 (cfml)
<!--- 2023-05-24
Short, Self Contained, Correct (Compilable), Example (SSCCE) of ColdFusion Bug CF-4212034
https://tracker.adobe.com/#/view/CF-4212034 (Please upvote)
GIST: https://gist.github.com/JamoCA/19dd449408fbec923f7c21a173a0f0dc
REQUIRES: spreadsheet-cfml https://github.com/cfsimplicity/spreadsheet-cfml
--->
<cfscript>
savecontent variable="csv" {
writeoutput('ID,Lot Size
1,15
2,25
3,35');
};
spreadsheet = new spreadsheet();
myQuery = spreadsheet.csvToQuery( csv=csv, firstRowIsHeader=true );
writedump(var=myQuery, label="query with a column header that contains a space");
// This works
lotSizeValues = valuearray(myQuery, "Lot Size");
writedump(var=lotSizeValues, label="valuearray works with Adobe ColdFusion and Lucee");
try{
myQuery2 = queryexecute("SELECT [Lot Size] AS LotSize FROM myQuery", {}, {"dbtype":"query"});
writedump(var=myQuery2, label="QoQ works when using Lucee");
} catch (any error){
writedump(var=error, label="QoQ fails when using Adobe ColdFusion");
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment