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 Exécuter.

Remarque : 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.

Syntaxe

VBScript

session.BuildResultSet(querydef) 

Perl

$session->BuildResultSet($querydef); 
Identificateur
Description
session
Objet Session représentant la session en cours d'accès à la base de données.
querydef
A Objet QueryDef that defines the desired query.
Return value
A Objet ResultSet suitable for eventual execution of the query.

Exemples

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(); 

Commentaires