valueArray

Returns an array of values for the given query and column.

valueArray(query, column) → returns array

Argument Reference

query query
Required

A query object

column string
Required

The column name whose values you want

Compatibility

Lucee:

Lucee also supports passing query.columnName as the first argument, however it appears to be deprecated syntax. Use queryColumnData() instead.

BoxLang:

Version 1.0.0+ Transpiles to queryColumnData in BoxLang.

Examples
Sample code invoking the valueArray function

Converts the id column values into an array

news = queryNew("id", "integer", [ {id:1}, {id:2} ]);
writeOutput( serializeJSON( valueArray(news, "id") ) );

Expected Result: [1,2]

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

Fork me on GitHub