Custom queries
Custom queries are user-defined summary pages that extend the functionality of Rational® Asset Analyzer. A custom query is a wrapper around a user-defined SQL select statement. Use the "Custom queries" page to define and perform custom-made queries against the inventory database. This page displays the custom queries that have been defined.
This page contains the following sections that help you with the indicated tasks. Click the link for more information on using each section.
- Context
- This section is in the upper-left corner of the page. It opens the "Bookmark this page" wizard in a separate window.
- Search assets
- Search the inventory database for custom queries and change the scope of a database search.
- Actions
- Select an action from the drop-down list on the right side of the page. From this list, you can select actions to perform on the current page:
- Result table
- Lists the defined custom queries that match the current
search criteria. To run a query that is not assigned to a page, click
the query in the Name or
Row column in the result
table. The results of the query are displayed on a page entitled with
the name of the query.
- Delete
- The Delete action requires a user ID with
administrative authority. Non-administrators can create, update, and
delete their own custom query assets. To delete custom queries from
the inventory, complete the following steps:
- Click the check boxes next to the custom queries of interest.
- Click the Delete link. After the Delete action is clicked, a confirmation prompt is displayed.
- Click OK. An I-level message is displayed.
For example:
DMH5362I: Deleted # rows.
- Export
- The Export action requires a user ID with
administrative authority. To export custom queries, complete the following
steps:
- Click the check boxes next to the custom queries of interest.
- Click the Export link. After the Export action is clicked, the selected queries are downloaded in a file named CqExport.xml on your workstation.
- Validate
- The Is valid column of the Custom query
summary page indicates if the corresponding custom query contains
valid SQL for the current Rational Asset Analyzer database schema.
Possible values are Yes (valid), No (invalid),
or Unknown.
- No identifies a custom query that is no longer valid because the underlying database schema has changed.
- Unknown indicates that this custom query is not executed because a migration has occurred and it is not known whether it is valid or not.
- You can revalidate custom queries that are in the Unknown state
in one of the following ways:
- Execute the custom queries individually to reestablish a Yes or No value in the Is valid column. To execute a particular custom query, click the link in the Name or Row column.
- Expand Advanced search and use the Is
valid attribute to identify all custom queries in the Unknown state.
Click the check boxes next to the custom queries of interest and then
click the Validate link. The Validate action
requires a user ID with administrative authority. After the Validate action
is clicked, an I-level message is displayed. For example:
DMH7894I: Custom query validation work added to work queue.
The validation task executes in the background. Check the status on the Database.
- Tip
- Inspect the Is valid column after any database migration, or any in-house activity that modifies the underlying database objects to verify that all custom queries in the inventory remain valid and in a usable state.
- For more information on the attributes shown in the result table, see the following topics:
-
- Common attributes
- Describes columns that are common to multiple assets.
- DMH_CUSTOM_QUERY database table
- Describes columns specific to custom queries.
Column sort: Click the following icons that appear in the heading for a column to sort the results by that column:
-
- Currently sorted in ascending order; click to sort in descending order.
-
- Currently sorted in descending order; click to sort in ascending order.
-
- Currently not sorted; click to add the column to the list of Advanced search Sort columns and to sort the results in ascending order.