Append stored queries

Applies to User Roles:

System Administrator

You can add, edit, or run stored queries from the Query window, which is accessible from the form in Database Manager or from the Application search form. Data entered into the from is automatically entered into the Query window to form the query. Depending on your permissions, you can edit and run that query or select a query from a list of stored queries.

Note: You must have the capability word QueryAdmin or query.stored.mod operator record to add or edit stored queries.

In this example, two stored queries for Incident Management (the probsummary file) are joined and saved.

To append stored queries:

  1. To open the query window from a Service Manager application:
    1. Open the application Search form.

      For this example, click Incident Management > Search Incidents.

    2. Open the More Actions menu.
    3. Choose Expert Search.

      The query window opens.

  2. To open the query window from a Database Manager search form:
    1. Open the form in Database Manager.

      For this example, type =probsummary in the Form field, and then press Enter.

    2. Open the More Actions menu.
    3. Choose Expert Search.

      The Query window opens.

  3. Click Select to display the list of stored queries for the associated file, and then double-click a query to select it.

    For this example, select deadline. The Stored Query record opens.

  4. Click Select.

    Service Manager returns you to the list of queries.

  5. Select another query from the list.

    For this example, select pri.1. The Stored Query record opens with additional buttons on the toolbar.

  6. Click one of these buttons to use this query in addition to the one you selected previously.
    • Click Append using & to add this query after the previous one using the and (&) operator.
    • Click Append using | to add this query after the previous one using the or (|) operator.
    • Click Insert using & to add this query before the previous one using the and (&) operator.
    • Click Insert using | to add this query before the previous one using the or (|) operator.

    For this example, click Append using &.

  7. You can click Execute Search to run the query without saving it or click Store to save your modified query for future use.

    For this example, click Store. The Stored Query Maintenance form opens.

  • The value in the Name field is that of the last appended or inserted stored query, pri.1.
  • The value in the Query field is the new query you created. (flag=true and status#"DEADLINE" and problem.status~="Cleared" and flag=true and priority.code="1").
  • For this example, enter the following information:
    • Give the query a unique Name. For this example, type pri.1&deadline.
    • Add a Description. For this example, type Priority 1 records in deadline alert.
    • Edit the Query, if necessary. For this example, delete the second and flag=true.
    • Specify any other controls you want.
  • Click Add.

    Service Manager returns you to the Query window and displays the message: “Query added to querystored file”.

  • You can click Execute Search to run the saved query at this point, or click Back to exit.

Related topics

Record retrieval
Retrieving records using the Query window method
Stored queries
The Database Manager utility
More Actions menu

Add a stored query
Add a stored query
Create stored queries from the Query Maintenance form
Update a stored query
Run a stored query

Stored query option definitions