BuildResultSet

Description

Creates and returns a result set that can be used to run a query.

This method creates a ResultSet object for the specified QueryDef object. You can then use the returned ResultSet object to run the query and store the resulting data.

Do not call this method until you have added all of the desired fields and filters to the QueryDef object. This method uses the information in the QueryDef object to build the set of data structures needed to store the query data. If you add new fields or filters to the QueryDef object after calling this method, the ResultSet object will not reflect the new additions. To run the query and fetch the resulting data, you must subsequently call the ResultSet object's Execute.

Note: To obtain the QueryDef object that you pass to this method, you must call the BuildQuery method. To construct a ResultSet object directly from a raw SQL query string, use the BuildSQLQuery method.

For an example of how to use BuildResultSet, see Running a query that has dynamic filters.

Syntax

VBScript


session.BuildResultSet(querydef) 

Perl


$session->BuildResultSet($querydef); 
Identifier
Description
session
The Session object that represents the current database-access session.
querydef
A QueryDef Object that defines the desired query.
Return value
A ResultSet Object suitable for eventual execution of the query.

Examples

VBScript


set sessionObj = GetSession 
' Create a query and result set to search for all records. 

set queryDefObj = sessionObj.BuildQuery("defect") 
queryDefObj.BuildField("id") 
set resultSetObj = sessionObj.BuildResultSet(queryDefObj)
resultSetObj.Execute 

Perl


$sessionObj = $entity->GetSession();

# Create a query and result set to search for all records. 
$queryDefObj = $sessionObj->BuildQuery("defect");
$queryDefObj->BuildField("id");
$resultSetObj = $sessionObj->BuildResultSet($queryDefObj);
$resultsetObj->Execute();