Triggers in the database have several uses.
Triggers allow you to perform the following tasks:
- Enforce business rules
- Validate input data
- Generate a unique value for a newly inserted row on a different file (surrogate
function)
- Write to other files for audit trail purposes
- Query from other files for cross-referencing purposes
- Access system functions (for example, print an exception message when
a rule is violated)
- Replicate data to different files to achieve data consistency