Adobe ColdFusion 8

getColumns

Description

Returns an array of strings containing the names of the columns in the query.

Category

Query interface

Syntax

public String[] getColumns()

Example

The following example retrieves the array of columns, then iterates over the list, writing each column name back to the user:

// Get the list of columns from the query
String[] columns = query.getColumns() ;
int nNumColumns = columns.length ;                    

// Print the list of columns to the user
response.write( "Columns in query: " ) ;
for( int i=0; i<nNumColumns; i++ )
{
    response.write( columns[i] + " " ) ;
}