BackUp LevelNext

CCFXRequest::GetQuery

CCFXQuery* CCFXRequest::GetQuery(void)

Retrieves the query that was passed to the tag. To pass a query to a custom tag, you use the QUERY attribute. This attribute should be set to the name of an existing query (created using the DBQUERY tag or another custom tag). The QUERY attribute is optional and should only be used by tags that need to process an existing dataset.

Returns an object of class CCFXQuery that represents the query that was passed to the tag. If no query was passed to the tag, NULL is returned. You are not responsible for freeing the memory allocated for the returned query (it will be automatically freed by ColdFusion after the request is completed).

Example

The following example retrieves the query which was passed to the tag. If no query was passed , an exception is thrown:

CCFXQuery* pQuery = pRequest->GetQuery() ;
if ( pQuery == NULL )
{
        pRequest->ThrowException(
            "Missing QUERY parameter",
            "You must pass a QUERY parameter in "
            "order for this tag to work correctly." ) ;
}

BackUp LevelNext

allaire

AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.