Adobe ColdFusion 8

CCFXQuery::GetData

Syntax

LPCSTR CCFXQuery::GetData(int iRow, int iColumn)

Description

Gets a data element from a row and column of a query. Row and column indexes begin with 1. You can determine the number of rows in a query by calling CCFXQuery::GetRowCount. You can determine the number of columns in a query by retrieving the list of columns using CCFXQuery::GetColumns, and then calling CCFXStringSet::GetCount on the returned string set.

Returns

Returns the value of the requested data element.

Parameters

Parameter

Description

iRow

Row to retrieve data from (1-based)

iColumn

Column to retrieve data from (1-based)

Example

The following example iterates over the elements of a query and writes the data in the query back to the user in a simple, space-delimited format:

int iRow, iCol ;
    int nNumCols = pQuery->GetColumns()->GetCount() ;
    int nNumRows = pQuery->GetRowCount() ;
    for ( iRow=1; iRow<=nNumRows; iRow++ )
    {
        for ( iCol=1; iCol<=nNumCols; iCol++ )
        {
        pRequest->Write( pQuery->GetData( iRow, iCol ) ) ;
        pRequest->Write( " " ) ;
        }
        pRequest->Write( "<BR>" ) ;
    }