Ccfxrequest::addquery - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

virtual void SetCustomData( LPVOID lpvData )
virtual LPVOID GetCustomData()

CCFXRequest::AddQuery

Syntax
CCFXQuery* CCFXRequest::AddQuery(LPCSTR lpszName,
CCFXStringSet* pColumns)
Description
Adds a query to the calling template. The query can be accessed by CFML tags (for example,
or
CFOUTPUT
CFTABLE
rows). To populate the query with data, call the
functions.
Returns
Returns a pointer to the query that was added to the template (an object of class
memory allocated for the returned query is freed automatically by ColdFusion after the request is
completed.
Parameters
Parameter
lpszName
pColumns
Example
The following example adds a query named 'People' to the calling template. The query has two
columns ('FirstName' and 'LastName') and two rows:
// Create a string set and add the column names to it
CCFXStringSet* pColumns = pRequest->CreateStringSet() ;
int iFirstName = pColumns->AddString( "FirstName" ) ;
int iLastName = pColumns->AddString( "LastName" ) ;
// Create a query that contains these columns
CCFXQuery* pQuery = pRequest->AddQuery( "People", pColumns ) ;
// Add data to the query
int iRow ;
iRow = pQuery->AddRow() ;
pQuery->SetData( iRow, iFirstName, "John" ) ;
pQuery->SetData( iRow, iLastName, "Smith" ) ;
iRow = pQuery->AddRow() ;
pQuery->SetData( iRow, iFirstName, "Jane" ) ;
pQuery->SetData( iRow, iLastName, "Doe" ) ;
758
Chapter 4: ColdFusion C++ CFX Reference
) within the template. After calling
Description
Name of query to add to the template (must be unique)
List of column names to be used in the query
CCFXRequest::SetCustomData
custom (tag specific) data to carry with a
request.
CCFXRequest::GetCustomData
custom (tag specific) data for a request.
, the query is empty (it has 0
AddQuery
CCFXQuery::AddRow
sets
gets
and
CCFXQuery::SetData
). The
CCFXQuery

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents