Need For Triggers
The triggers are mainly needed for the following purposes:
- Maintaining complex integrity constraints.
- Auditing information in a table by recording the changes.
- Automatically signaling other programs that action needs to take place when some specific changes are made to a table.
- Enforcing complex business rules (i.e., the integrity checks or conditions pertaining to specific application.
Database triggers are usually defined on tables. However database triggers can be defined on views to enable insert, update or delete operations on join views. Triggers can also be used to execute other triggers, procedures and functions.