What are the types of triggers ?

Answer Posted / arpit gautam

There are two types of triggers:

1.Row Triggers and Statement Triggers

A row trigger is fired each time the table is affected by
the triggering statement. For example, if an UPDATE
statement updates multiple rows of a table, a row trigger
is fired once for each row affected by the UPDATE
statement. If a triggering statement affects no rows, a row
trigger is not run.

A statement trigger is fired once on behalf of the
triggering statement, regardless of the number of rows in
the table that the triggering statement affects, even if no
rows are affected. For example, if a DELETE statement
deletes several rows from a table, a statement-level DELETE
trigger is fired only once.


2.BEFORE and AFTER Triggers

BEFORE triggers run the trigger action before the
triggering statement is run.

AFTER triggers run the trigger action after the triggering
statement is run.

Trigger Type Combinations
a. BEFORE statement trigger

b.BEFORE row trigger

c.AFTER statement trigger

d.AFTER row trigger


3.INSTEAD OF Triggers

INSTEAD OF triggers provide a transparent way of modifying
views that cannot be modified directly through DML
statements (INSERT, UPDATE, and DELETE). These triggers are
called INSTEAD OF triggers because, unlike other types of
triggers, Oracle fires the trigger instead of executing the
triggering statement.

4.Triggers on System Events and User Events

System events

Database startup and shutdown

Data Guard role transitions

Server error message events

User events

User logon and logoff

DDL statements (CREATE, ALTER, and DROP)

DML statements (INSERT, DELETE, and UPDATE)

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to enter binary numbers in sql statements? : Sql dba

493


What are the two types of exceptions in pl/sql?

548


What is on delete set null?

570


hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews

1527


What are the benefits of triggers?

604






How do I know if I have sql express or standard?

604


What is the difference between sql, mysql and sql server?

533


how can we know the number of days between two given dates using mysql? : Sql dba

546


Is it possible to pass parameters to triggers?

575


What is data abstraction in sql?

513


What are the different sql languages?

540


What are tables and fields in the database?

554


Is join same as left join?

532


What is record in pl sql?

593


Which are the different types of indexes in sql?

563