Tool Mentor: Working with Queries Using Rational ClearQuest
This tool mentor describes how to use queries to retrieve records from a ClearQuest database using Rational ClearQuest.
Tool: Rational ClearQuest
Relationships
Main Description

Overview

This tool mentor provides the steps for the following:

Creating and Saving Queries

There are multiple ways to create queries, but each one requires you to name, define, run, and/or save the query. When you first use a database, the Query wizard walks you through choosing the fields you want to display and enables you to choose the fields and corresponding values you want to use as query filters. Later, when you are familiar with building queries, you can use the Query window to edit query filters and set up display fields.

Tool Steps

The following steps are performed to create a query with the Query Wizard using Rational ClearQuest:

  1. Make sure the option Use Query Wizard is checked in the Query menu.
  2. Select Query > New Query to open the Choose Record Type dialog box.
  3. Select a record type and click OK.
  4. In the ClearQuest Query Wizard dialog box, do the following:
    1. In Start with an Existing Query, specify the name of a query to use as a template.
    2. Click Browse and then Yes to see a list of available queries to use as templates. We recommend you choose a query under Public Queries.
    3. Click Next to create a new, blank query with the Query Wizard.
  5. The Define How the Query Displays dialog box enables you to customize the display of the query results by choosing the fields to display.For example, if you select ID, State, and Headline to use as display fields, your query results display only those three fields.
    1. To display the fields of your choice, double-click the record to move it the Display grid. The Display grid includes the following columns: Field, Title, Sort, Show, and Sort Order.
    2. Select the display fields you want, and click Next.
  6. Select the fields to use as query filters. Query filters determine what records are displayed.
    1. In the Select Fields to Use as Query Filters dialog box, choose the fields to use as query filters by double-clicking the field to move it to the Filters pane.
    2. Click Next.
  7. The Filter definition page of the Query Wizard lets you define the query filters by creating expressions that search for the legal value or range of values you specify. The Filter definition page is divided in two panes: the Filters pane (on the left,) which lists the fields you selected, and the Filter tool (on the right,) which lets you define filter values.
    1. Click the filter you want to define.
    2. In the Filter tool (on the right) choose the operator you want to use. The list of available operators is dependent on what type of data is required for the field. Use the Not check box to indicate that you want to perform the opposite of the selected operator.
    3. Click Values to see a list of values available for this filter.
    4. In the Values dialog box, select the values you want to include, and click OK.
    5. Click Set Value to set the value for the selected field. Repeat this step for each field.
  8. To finish, click Run. The query is assigned a default name and runs. A Query window appears displaying the results.
  9. If you are satisfied with the results and want to run the query at other times, save the query by clicking File > Save or File > Save As. Specify a name and location to store the query.
  10. If you want to discard the query and close the Query window, click File > Close and then click No.

Viewing Query Results

Query results are displayed in the Results set tab and listed in a grid, according to the fields you select in the Display editor. The record data is organized under various tabs in the Results grid, such as Main, Analysis, Resolution. The fields appearing on each tab and the number of tabs for each record may vary depending on your ClearQuest environment.

Tool Steps

The following steps are performed to view the results of a query using Rational ClearQuest:

  1. Click the row that contains the record's information.
  2. To see more information about the record, click the appropriate tab.

Displaying Query Results

Rational ClearQuest stores queries in the Private Queries and Public Queries folders. Queries you create are automatically stored in the Personal Queries folder. Both folders contain queries that are ready to be run or to be customized for personal use.

Tool Steps

The following steps are performed to display query results using Rational ClearQuest:

  1. Open either the Private Queries or Public Queries folder to reveal the queries they contain.
  2. Double-click the query you want to run.
  3. If prompted, complete or select the options in the dialog box, and click OK.

Printing Query Results

After running a query, you can print the records appearing on the Results set tab. You have the option to add headers and footers when printing the query results. The report format that is associated with the type of the record determines the fields that are printed.

Tool Steps

The following steps are performed to print a query result using Rational ClearQuest:

  1. Run a query and select the Result set tab.
  2. You can add headers and footers to your query grids that are included when you print. To modify these headers and footers, do the following:
    1. Click File > Headers/Footers
    2. Click the Headers tab to add or modify the header and type the test you want to use in the respective column. You can have it centered, left-justified, or right-justified.
    3. Click the Footers tab to add or modify the footer.
    4. Select Save setting to profile if you want these settings to be applied the next time you run Rational ClearQuest
    5. Click OK.
  3. Click File > Print Grid or click the Print toolbar button.
  4. In the Print dialog box, set or specify options in Printer, Print to file, Print range, or Copies as needed, and click OK.