Jump to content

Database trigger

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 24.224.128.57 (talk) at 01:52, 11 January 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Database triggers are procedures that are stored in a database and are executed or "fired" when a table is modified. They are very powerful tools that can be used to preform many tasks such as restricting access to specific data, preform logging, or auditing of data sets.

There are two classes of triggers, they are either "Row Triggers" or "Statement Triggers". With row triggers you can define an action for every row of a table, while statement triggers only occur once and are not dependant on the shape of the data.

Each class can be of several types. There are "BEFORE Triggers" and "AFTER triggers" which alters the time of execution of the trigger. There is also an "INTEAD OF Trigger" which is a conditional trigger that will fire instead of the triggering statement.

Further reading

Oracles Database Triggers