How to convert a coldfusion query to an array

There’s a quick way to convert a query column to an array. Of course there a more, but a nice one is to do that with the functions ValueList() and ListToArray().

Let’s assume your query is named “superQuery”, and a column is named “superColumn”. You’re able to turn that into an array with:

<cfset mybrandnewArray = ListToArray(ValueList(superQuery.superColumn)) />

Schreibe einen Kommentar