A database trigger is procedural code that is automatically executed in response to certain events on a particular table in the database. Triggers can restrict access to specific data, perform logging, or audit data modifications.
There are "BEFORE" triggers and "AFTER" triggers which identifies the time of execution of the trigger. A trigger can be set to automatically run a stored procedure before and/or after an update, delete, or insert event occurs in a table.
There are three triggering events that cause triggers to fire:
•INSERT event (as a new record is being inserted into the database).
•UPDATE event (as a record is being changed).
•DELETE event (as a record is being deleted).
Notes:
•R:BASE triggers occur only once per INSERT, UPDATE, or DELETE event.
•A table can have both "BEFORE" and "AFTER" triggers, only one, or none.
•Triggers are stored in the System Table SYS_TRIGGERS
•Procedures that are run with triggers must be stored with no arguments. See "Argument List" under Using Stored Procedures