Defining a trigger for a query

About this task

After you have defined a query in the Database Interface Designer, you can define a trigger specification that can be used to launch a map using that same query as a data source.

To define a trigger specification:

Procedure

  1. In the Database Interface Designer, select the query for which you want to define a trigger specification.
  2. From the Query menu, select Define Trigger.
    The Trigger Specification dialog appears. When initially displayed, the lists on the left show all of the tables referenced by the SELECT statement of the selected query.
  3. Determine whether you can define row-based triggering for this query as determined by the availability of the Row-based triggering check box.
    If this is a new query and the table supports it, this check box will be enabled as the default value. (For old queries, this check box will be cleared as the default value, which means that you could use the functionality by enabling it. In another scenario, the entire check box could be disabled because this functionality is not available for the query and table being used.)
  4. To specify the events, select a table name from the Insert into or Delete from lists.

    or

    Select a table name from the Update of list.

    The name of the table you select will be either the destination into which data will be inserted, from which data will be deleted, or in which data will be updated when the specified event occurs.

    Note: Delete from cannot be used with row-based triggering.
  5. To move the table name, in the text box area corresponding to the selected table name (either Insert into, Delete from, or Update of), click the arrow button.
    The table name moves into the corresponding list.
  6. Select as many names as necessary to define the event(s) that must occur so that conditions can be met for the trigger specification.
  7. If more than one table is added to a list, you can define conditions that must be met. Select either the AND or OR radio button located directly above each list. For more information, refer to "Specifying a combination of different event classes".
    The AND option dictates that the condition is not met until the event occurs for all tables in the list when data is either inserted, deleted, or updated. The OR option dictates that the condition is met when the specified event occurs in only one table in the list.
  8. To define an additional condition that will be evaluated only after the other specified event(s) has/have occurred, enter an expression in the When field. For more information, refer to "Specifying when".
  9. After you have finished, click OK to save your trigger specification.

    The query with the trigger specification is represented in the Navigator with an icon displayed next to the name.

    Note: To modify or delete an event, use the same procedure as indicated above. Select the table name in the list on the right and click the corresponding left arrow button. The When expression can also be edited or deleted as required.