Previous Topic: Add a Table Override TriggerNext Topic: Define the SQL Code for Table Override Triggers


Define a Table Override Trigger

You can use the Table Trigger Editor to define a table override trigger. Specify general information for a table override trigger, such as the action for which the trigger should fire, when the trigger should fire, how the trigger should fire, and so forth.

To define a table override trigger

  1. Right-click the table for which you want to define a trigger and click Trigger Properties.

    The Table Trigger Editor opens.

  2. Select the trigger in the Navigation Grid that you want to define.

    Note: Click New New icon in property editors to create a new object on the toolbar to create a new trigger. Use the Enter filter text box to filter a very large list of triggers to quickly locate the one that you want to define.

  3. Work with the following options:
    Name

    Displays the table trigger name. You can change the trigger name in this field.

    Insert

    Specifies to execute the table trigger on INSERT.

    Update

    Specifies to execute the table trigger on UPDATE.

    Delete

    Specifies to execute the table trigger on DELETE.

    Fire

    Specifies when the table trigger is executed. Make a selection from the drop-down control.

    Generate

    Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.

  4. Click the General tab and work with the following options:
    New

    Specifies the name to use to reference the post-change data in the table. Enter the name in this field. You can use the %RefClause macro to include the REFERENCES clause in the trigger.

    Old

    Specifies the name to use to reference the pre-change data in the table. Enter the name in this field. You can use the %RefClause macro to include the REFERENCES clause in the trigger.

    Parent

    Displays the name of the selected table (if it is the parent table in a relationship) or the parent of the selected table, for each relationship in which the selected table is involved.

    Child

    Displays the name of the selected table (if it is the child table in a relationship) or the child of the selected table, for each relationship in which the selected table is involved.

    Verb Phrase

    Displays the name of all relationships for the selected table.

    Integrity Rule

    List the referential integrity rules that apply to the selected relationship. Rules are abbreviated and indicate the RI trigger action, such as CHILD UPDATE (CU:) and the RI type, such as RESTRICT (R).

  5. Click the Code tab to define the code type for the table trigger.
  6. Click the Expanded tab to view expanded code for the table trigger.
  7. (Optional) Click the Comment tab and enter any comments that you want to associate with the table trigger.
  8. (Optional) Click the UDP tab to work with user-defined properties for the table trigger.
  9. (Optional) Click the Notes tab to view history associated with the table trigger and to add or view user notes.
  10. Click Close.

    The table override trigger is defined and the Table Trigger Editor closes.

More information:

Add a Table Override Trigger

Define the SQL Code for Table Override Triggers

Review Expanded Code for a Table Override Trigger

Enter a Comment for a Table Override Trigger

Define Table Override Trigger User-Defined Property Values