CREATE TRIGGER
CREATE [OR REPLACE]  TRIGGER [triggerschema.]triggername 
{BEFORE | AFTER | INSTEAD OF} 
{INSERT | DELETE | UPDATE [OF column[,column...]]}
[OR {INSERT | DELETE | UPDATE [OF column[,column ...]]}...]
ON [tableschema.]{tablename | viewname}
   [REFERENCING [OLD [AS] old ] [NEW [AS] new]]
   [FOR EACH ROW [WHEN condition]] 
   plsql_block
					

Creates a trigger, a stored PL/SQL block associated with a table or view, which is automatically executed in response to a particular SQL statement or set of statements.

Keywords

triggerschema

The name of the schema to contain the trigger. If omitted, the current schema is assumed.

triggername

The name of the trigger to be created.

BEFORE

Specifies that the trigger is to be fired before executing the triggering statement.

AFTER

Specifies that the trigger is to be fired after executing the triggering statement.

INSTEAD OF

Specifies that the code associated with this trigger, instead of the event that originally fired the trigger, is to be executed.

INSERT

Specifies that the trigger is to be fired when an INSERT statement adds a row to the table.

DELETE

Specifies that the trigger is to be fired when a DELETE statement removes a row from the table.

UPDATE OF

Specifies that the trigger is to be fired when an UPDATE statement changes the value in one of the columns specified in the OF clause. If the OF clause is omitted, an UPDATE to any column will cause the trigger to fire.

ON

Introduces the clause that specifies the name of the table on which the ...

Get Oracle SQL: the Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.