query

Create and populate a query object. You can initialize with data by passing arrays of data as arguments, where the argument name is the desired column name and each item in the array is the value for a row.

query() → returns query

This function requires Lucee.  Not supported on Adobe ColdFusion, etc.

Examples
Sample code invoking the query function

Create an empty query object

<cfscript>myQuery = query();</cfscript>

Create query object with some initial data

<cfscript>myQuery = query(foo: [1,2,3], bar: ['a','b','c']);</cfscript>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub