<CF_ArrayToQuery>

Takes a two-dimensional array and converts it into a query result set.

Parameters
ARRAY Required. The array you want to convert into a query. Must be a "square" two-dimensional array.
QUERY Required. The name for the new query. You would then be able to use this name for the QUERY attribute of a CFOUTPUT tag, for example.
COLUMNLIST Required. The column names to be used to constuct the new query, as a comma-separated list.

Example
The following code creates a "test" array, then converts it to a query. This example then uses the CFX_ShowQuery tag to display the contents of the new query. You don't need the CFX_ShowQuery tag to work with the CF_ArrayToQuery tag-- it's just here to illustrate the point.

<CFSET MyArray = ArrayNew(2)> <CFSET MyArray[1][1] = "A1"> <CFSET MyArray[2][1] = "B1"> <CFSET MyArray[3][1] = "C1"> <CFSET MyArray[1][2] = "A2"> <CFSET MyArray[2][2] = "B2"> <CFSET MyArray[3][2] = "C2"> <CFSET MyArray[1][3] = "A3"> <CFSET MyArray[2][3] = "B3"> <CFSET MyArray[3][3] = "C3"> <CFSET MyArray[1][4] = "A4"> <CFSET MyArray[2][4] = "B4"> <CFSET MyArray[3][4] = "C4"> <CF_ArrayToQuery ARRAY="MyArray" QUERY="MyNewQuery" COLUMNLIST="ColA,ColB,ColC"> Outputting query... <CFX_ShowQuery QUERY="MyNewQuery"> Here's the output created by the above code:
Outputting query...
COLA COLB COLC
A1B1C1
A2B2C2
A3B3C3
A4B4C4