Specifying Trigger Action Settings |
Once you have indicated the trigger name and the table in which the trigger is created, you can then specify the type of actions the trigger will perform. The settings are indicated as follows:
Action Time: The trigger action time specifies whether a trigger should fire before or after the SQL statement that activates the trigger. You can use the BEFORE and AFTER keywords to specify the trigger action time. The BEFORE keyword indicates the trigger action will fire before the trigger statement. The AFTER keyword indicates the trigger action will fire after the trigger statement. You can only specify one trigger time for each trigger.
Trigger Event: The trigger event is the database operation that causes a trigger to execute (or fire). The trigger event may be an Insert, Update, or Delete statement that operates on the trigger table. You can only specify one trigger event for each trigger.
Trigger Type: The trigger type specifies how many times the trigger will fire for each trigger event. There are two types of triggers: row triggers and statement triggers. The FOR EACH ROW keywords specify a row trigger, which fires a trigger action once for each row modified by the trigger event. The FOR EACH STATEMENT keyword specifies a statement trigger, which fires a trigger action once for each trigger event.
Referencing Clause. If the selected Trigger type is FOR EACH ROW, the advanced setting tab is highlighted. Click this tab to define the REFERENCING clause. The REFERENCING clause defines correlation names for the old and new values of a column. This is primarily used when you cannot use the default OLD and NEW names because of a conflict with a table with the same name.
Related topic:
Creating
a Trigger
Indicating the Referencing Clause
Assigning a Trigger Name and Table