Module summary
In this module, you learned how to work with queries using
the Rational®
ClearQuest® Perl
API.
You use methods of the Session, QueryDef and ResultSet objects
to run, modify, and build queries.
- You build a query by creating a QueryDef object by calling the BuildQuery method of the Session object.
- You move through the ResultSet returned by a query to retrieve the data for each record it includes.
- You define a query's search criteria with query filters that are based on comparisons to the fields of each record in a user database. The query returns each record in the database that matches your search criteria in a ResultSet object.
- You can use methods of the QueryFieldDef object to specify the sort order of a result set.
Lessons learned
By completing this tutorial/module, you learned about the following concepts and tasks:- How to create a query.
- How to create query filters.
- How to move through the data returned in a result set.
- How to sort a result set.
Note: If you plan to view or modify a record, your query must return the ID field of the record. With this ID, you can then use the GetEntity method of the Session object to obtain the corresponding Entity object. The next module introduces how to work with records.