Contents > CFML Reference > ColdFusion Java CFX Reference > Query interface > getColumns PreviousNext

getColumns

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

Query interface

public String[] getColumns()

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] + " " ) ;
} 

Contents > CFML Reference > ColdFusion Java CFX Reference > Query interface > getColumns PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.