A trigger (trigger) is a special stored procedure whose execution is not invoked by the program or manually, but is triggered by an event, such as when an operation on a table (Insert,delete, update) activates it for execution. Triggers are often used to enforce data integrity constraints, business rules, and so on. Triggers can be found in the dba_triggers, user_triggers data dictionary.
Advantages OF Triggers
Triggers can implement cascading changes through related tables in the database, but these changes can be performed more efficiently by cascading referential integrity constraints. Triggers can enforce more complex constraints than constraints defined with a CHECK constraint. Unlike CHECK constraints, triggers can reference columns in other tables. For example, a trigger can compare inserted or updated data with a SELECT from another table, and perform other actions, such as modifying data or displaying user-defined error information. Triggers can also evaluate the state of the tables before and after data modification and take countermeasures based on their differences. Multiple similar triggers (INSERT, UPDATE, or DELETE) in a table allow multiple different actions to respond to the same modification statement
The specific definition of Oracle triggers, when to use! The advantage is what!