Syntax:
Create [or replace] trigger trigger_name: Create a trigger and set the trigger name. If or replace is selected, the trigger is replaced if it already exists.
[Befor | after]: refers to the trigger day, beforc between operations, after the operation is triggered
Instead of: Used to replace a trigger. The trigger type defined for view operations
Insert | update of column name | Delete, triggering event, which can be insert, update, delete, or partially update added to a data table
On [Table Name | View | database | schema]: refers to the trigger object of a trigger. It can be a table, view, database, or mode (user)
Referencing [old as Mark] [new as Mark] [parent as Mark]: defines aliases for ": Old", ": New", ": parent"
[For each row]: defines a row-Level Trigger. If this parameter is not specified, a table-Level Trigger is defined.
[Follows trigger name:] configure the execution sequence of multiple triggers
[Disable:] A trigger is enabled by default after it is created. You can use this option to disable it.
[When trigger condition]: triggers are executed when the specified condition is met.
[Declare]: The subject declaration part of the trigger, which defines variables or cursors.
[Pragma autonomous_transaction;] autonomous transaction statement
Begin: Main part of the program
End: the end tag of the trigger.
The trigger does not receive any listening parameters, and is automatically called only after a trigger event is generated.
Trigger 1 (learning notes)