Enabling Triggers

Previous
Previous
Next
Next

By default, a trigger is automatically enabled when it is created. However, it can be disabled if necessary. After you complete the task that requires the trigger to be disabled, reenable the trigger so that it fires when appropriate.

To enable a disabled trigger, use the ALTER TRIGGER statement with the ENABLE option as shown in Example: Enabling a Specific Trigger.

Enabling a Specific Trigger

ALTER TRIGGER log_emp_update ENABLE;

All triggers defined for a specific table can be enabled with one statement using the ALTER TABLE statement with the ENABLE clause with the ALL TRIGGERS option. Example: Enabling All Triggers for a Table shows how to enable all triggers defined for the departments table.

Enabling All Triggers for a Table

ALTER TABLE departments ENABLE ALL TRIGGERS;