Specifying Trigger Action Settings

How To

After identified the trigger's name and table, specify the type of actions the trigger will perform. The settings are as follows:

Action Time: The trigger action time specifies whether a trigger should fire (i.e., begin executing) before or after the SQL statement that activated the trigger. The BEFORE and AFTER keywords specify the trigger's action time. The BEFORE keyword indicates the trigger action fires before the trigger statement. The AFTER keyword indicates the trigger action fires after the trigger statement. A trigger cannot have more than a single trigger time.

Trigger Event: The trigger event is the database operation that causes a trigger to execute (i.e., fire). The trigger event may be an Insert, Update, or Delete statement that operates on the trigger's table. Only a single trigger event can be specified for each trigger.

Trigger Type: Specifies how many times the trigger fires for each trigger event. There are two types of triggers: row triggers and statement triggers. The FOR EACH ROW keyword specifies a row trigger. Row triggers fire a trigger action once for each row modified by the trigger event. The FOR EACH STATEMENT keyword specifies a statement trigger. Statement triggers fire a trigger action once for each trigger event.

Referencing Clause: The advanced setting tab is highlighted when the selected Trigger type is FOR EACH ROW. 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.