Why are Triggers important?
The importance of Triggers are:
- Automated Action: It helps to automate actions in response to events on table or views.
- Data integrity: Constraint can be applied to the data with the help of trigger.It is used to ensure referential integrity.
- Consistency: It helps to maintain the consistency of the database by performing immediate responses to specific events.
- Error handling: It helps in error handling by responding to the errors. For example, If specific condition is not met it will provide an error message.
PL/SQL Triggers
PL/SQL stands for Procedural Language/ Structured Query Language. It has block structure programming features.PL/SQL supports SQL queries. It also supports the declaration of the variables, control statements, Functions, Records, Cursor, Procedure, and Triggers.PL/SQL contains a declaration section, execution section, and exception-handling section. Declare and exception handling sections are optional.
Syntax:
Declaration section
BEGIN
Execution section
EXCEPTION
Exception section
END;
Contact Us