Last active
May 24, 2023 18:12
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- 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