Compound Trigger Dialog¶
Use the Compound Trigger dialog to create a compound trigger or modify an
existing compound trigger. Compound Trigger is supported only for EPAS server
12 and above. A compound trigger executes a specified code when certain events
occur.
The Compound Trigger dialog organizes the development of a compound trigger
through the following dialog tabs: General, Events, and Code. The SQL
tab displays the SQL code generated by dialog selections.
Create Compound Trigger dialog - General tab¶
Use the fields in the General tab to identify the compound trigger:
Use the
Namefield to add a descriptive name for the compound trigger. This must be distinct from the name of any other compound trigger for the same table. The name will be displayed in theBrowsertree control.Store notes about the compound trigger in the
Commentfield.
Create Compound Trigger dialog - General tab - Trigger enable option¶
Trigger enabledfield is available in compound trigger dialog once the trigger is created by selecting thepropertiesof the trigger. You can select one of the four options available.
Click the Events tab to continue.
Create Compound Trigger dialog - Events tab¶
Use the fields in the Events tab to specify how and when the compound trigger fires:
Select the type of event(s) that will invoke the compound trigger; to select an event type, move the switch next to the event to the
YESposition. The supported event types areINSERT,UPDATE,DELETEandTRUNCATE. Views cannot have TRUNCATE triggers.Use the
Whenfield to provide a boolean condition that will invoke the compound trigger.If defining a column-specific compound trigger, use the
Columnsfield to specify the columns or columns that are the target of the compound trigger.
Click the Code tab to continue.
Create Compound Trigger dialog - Code tab¶
Use the Code field to specify the code for the five timing events
BEFORE STATEMENT, AFTER STATEMENT, BEFORE EACH ROW, AFTER EACH ROW,
INSTEAD OF EACH ROW that will be invoked when the compound trigger fires.
Basic template is provided with place holders.
Click the SQL tab to continue.
Your entries in the Compound Trigger dialog generate a SQL command (see an example
below). Use the SQL tab for review; revisit or switch tabs to make any changes
to the SQL command.
Example¶
The following is an example of the sql command generated by user selections in
the Compound Trigger dialog:
Create Compound Trigger dialog - SQL tab¶
The example demonstrates creating a compound trigger named test_ct.
Click the
Infobutton (i) to access online help.Click the
Savebutton to save work.Click the
Cancelbutton to exit without saving work.Click the
Resetbutton to restore configuration parameters.