valueArray

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

valueArray(query, column) → returns array

valueArray Argument Reference

query
Required

A query object

column
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.

Examples sample code invoking the valueArray function


Simple valueArray Example

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]


Fork me on GitHub