What Is a Database Trigger in Oracle


Database triggers is a consist os sql and plsq statement which is executed on an predefined event.Database triggers are stored as a database object in oracle.

Database triggers is an oracle objects which consist set of statement that is executed on a purticular event.The Statement is a PLSQL block or a combination of set of SQL command/statement and PLSQL Block.

The database triggers which are stored as an object is based on some base table(tables in oracle) where the events are predefined. The various events which are Predefined is all DMl (Data Manipulation Language) INSERT,DELETE UPDATE. The Trigger if created is invoked implicitly on the predefined event on which the database trigger is created. Several triggers will be executed simultaneously if more than one triggers are defined for any TABLE for a purticular event.

Some developer on oracle do get confused with trigger in oracle forms and database triggers. Database triggers are stored procedure but triggers in forms are statement which are executed. Eg When an operation clicks on a button in oracle forms 2 events can be executed for that particular item(buttom) when_mouse_click and when_button_pressed. So the Plsql statement written for any of these trigger will be executes and this is not to be mixed up with database triggers.

Database triggers are created by using the using CREATE TRIGGER TRIGGERNAME DDL statement

Triggers are dropped by issuing Drop DDL statements.

Triggers created can be DISABLED by using ALTER TRIGGER COMMAND. A triggers which is disabled will not be executed but it exists as an object in the databases. a disabled trigger has to be Enabled again if the trigger is to be applied in operations.