Ccfxquery::addrow; Ccfxquery::getcolumns - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

296

CCFXQuery::AddRow

int CCFXQuery::AddRow(void)
Add a new row to the query. You should call this function each time you want to
append a row to the query.
Returns the index of the row that was appended to the query.
Example
The following example demonstrates the addition of 2 rows to a query that has 3
columns ('City', 'State', and 'Zip'):
// First row
int iRow ;
iRow = pQuery->AddRow() ;
pQuery->SetData( iRow, iCity, "Minneapolis" ) ;
pQuery->SetData( iRow, iState, "MN" ) ;
pQuery->SetData( iRow, iZip, "55345" ) ;
// Second row
iRow = pQuery->AddRow() ;
pQuery->SetData( iRow, iCity, "St. Paul" ) ;
pQuery->SetData( iRow, iState, "MN" ) ;
pQuery->SetData( iRow, iZip, "55105" ) ;

CCFXQuery::GetColumns

CCFXStringSet* CCFXQuery::GetColumns(void)
Retrieves a list of the column names contained in the query.
Returns an object of
in the query. You are not responsible for freeing the memory allocated for the returned
string set (it will be freed automatically by ColdFusion after the request is completed).
Example
The following example retrieves the list of columns and then iterates over the list,
writing each column name back to the user.
// Get the list of columns from the query
CCFXStringSet* pColumns = pQuery->GetColumns() ;
int nNumColumns = pColumns->GetCount() ;
// Print the list of columns to the user
pRequest->Write( "Columns in query: " ) ;
for( int i=1; i<=nNumColumns; i++ )
{
pRequest->Write( pColumns->GetString( i ) ) ;
pRequest->Write( " " ) ;
}
CCFXStringSet Class
that contains a list of the columns contained
Developing Web Applications with ColdFusion

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 4.5

Table of Contents