What is a trigger ?

Answer Posted / shaikkhalandar407@gmail.com

Triggers are stored programs that are fired automatically when some events occur. The code to be fired can be defined as per the requirement.

Oracle has also provided the facility to mention the event upon which the trigger needs to be fire and the timing of the execution

Benefits of Triggers :
Generating some derived column values automatically
Enforcing referential integrity
Event logging and storing information on table access
Auditing
Synchronous replication of tables
Imposing security authorizations
Preventing invalid transactions
Types of Triggers in Oracle
Triggers can be classified based on the following parameters.

Classification based on the timing
BEFORE Trigger: It fires before the specified event has occurred.
AFTER Trigger: It fires after the specified event has occurred.
INSTEAD OF Trigger: A special type. You will learn more about the further topics. (only for DML )
Classification based on the level
STATEMENT level Trigger: It fires one time for the specified event statement.
ROW level Trigger: It fires for each record that got affected in the specified event. (only for DML)
Classification based on the Event
DML Trigger: It fires when the DML event is specified (INSERT/UPDATE/DELETE)
DDL Trigger: It fires when the DDL event is specified (CREATE/ALTER)
DATABASE Trigger: It fires when the database event is specified (LOGON/LOGOFF/STARTUP/SHUTDOWN)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between having clause and where clause?

572


how can we take a backup of a mysql table and how can we restore it. ? : Sql dba

520


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

533


What is sqlcontext?

551


Can we use commit inside a trigger?

529






what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba

558


What is meant by temporal data?

546


What is the difference between cross join and natural join?

566


what is the difference between a web-garden and a web-farm? : Sql dba

556


What is difference between sql and oracle?

568


what are the different type of sql's statements ? : Sql dba

522


What is dcl in sql?

528


explain the difference between bool, tinyint and bit. : Sql dba

526


What are predefined functions in sql?

535


Can unique keys be null?

486