Overview
This tool mentor provides the steps for the following:
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:
-
Make sure the option Use Query Wizard is checked in the Query menu.
-
Select Query > New Query to open the Choose Record Type dialog box.
-
Select a record type and click OK.
-
In the ClearQuest Query Wizard dialog box, do the following:
-
In Start with an Existing Query, specify the name of a query to use as a template.
-
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.
-
Click Next to create a new, blank query with the Query Wizard.
-
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.
-
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.
-
Select the display fields you want, and click Next.
-
Select the fields to use as query filters. Query filters determine what records are displayed.
-
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.
-
Click Next.
-
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.
-
-
Click the filter you want to define.
-
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.
-
Click Values to see a list of values available for this filter.
-
In the Values dialog box, select the values you want to include, and click OK.
-
Click Set Value to set the value for the selected field. Repeat this step for each field.
-
To finish, click Run. The query is assigned a default name and runs. A Query window appears displaying the
results.
-
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.
-
If you want to discard the query and close the Query window, click File > Close and then click No.
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:
-
Click the row that contains the record's information.
-
To see more information about the record, click the appropriate tab.
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:
-
Open either the Private Queries or Public Queries folder to reveal the queries they contain.
-
Double-click the query you want to run.
-
If prompted, complete or select the options in the dialog box, and click OK.
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:
-
Run a query and select the Result set tab.
-
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:
-
Click File > Headers/Footers
-
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.
-
Click the Footers tab to add or modify the footer.
-
Select Save setting to profile if you want these settings to be applied the next time you run
Rational ClearQuest
-
Click OK.
-
Click File > Print Grid or click the Print toolbar button.
-
In the Print dialog box, set or specify options in Printer, Print to file, Print range,
or Copies as needed, and click OK.
|