queryColumnData

Returns the data in a query column. See also valueArray for use in ACF.

queryColumnData(query, columnName [, closure]) → returns array

Member Function Syntax

query.columnData(columnName [, closure])

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

Argument Reference

query query
Required

columnName string
Required

closure function

Examples
Sample code invoking the queryColumnData function

myQuery = QueryNew( '' );
names = [ 'Indra','Elizabeth','Harry','Seth' ];
queryAddColumn( myQuery,'name','varchar',names );
result = queryColumnData( myQuery,'name' );
Dump( var='#result#' );

myQuery = QueryNew( '' );
names = [ 'Indra','Elizabeth','Harry','Seth' ];
queryAddColumn( myQuery,'name','varchar',names );
result = myQuery.columnData( 'name' );
Dump( var='#result#' );

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

Fork me on GitHub