Created
January 30, 2026 08:51
-
-
Save trycf/e37aa476dd21074ab5752ecb67c95c96 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains hidden or 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
| <cfscript> | |
| idList = "A1,A2,B1,B4,C6"; | |
| writeOutput("Lista di id: #idList#<hr>"); | |
| writeOutput("Codice originale"); | |
| queryObj = queryNew("IDCODICE","VarChar"); | |
| for (item in listToArray(idList)) { | |
| qcr = queryAddRow(queryObj); | |
| querySetCell(queryObj, "IDCODICE", item, qcr); | |
| } | |
| writeDump(var=queryObj, label="queryObj"); | |
| writeOutput("<hr>Con for senza querySetCell<br/>"); | |
| queryObj2 = queryNew("IDCODICE","VarChar"); | |
| for (item in listToArray(idList)) { | |
| queryAddRow(queryObj2, {"IDCODICE" = item}); | |
| } | |
| writeDump(var=queryObj2, label="queryObj"); | |
| queryObj3 = queryNew("IDCODICE","VarChar"); | |
| ids = listToArray(idList); | |
| for (id in ids) { | |
| queryAddRow(queryObj3, {"IDCODICE" = id}); | |
| } | |
| writeDump(var=queryObj2, label="queryObj"); | |
| </cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment