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 are the two parts of design view?

772


What are the possible values that can be stored in a boolean data field?

721


Why do we need view in sql?

732


What jobs use sql?

721


How do I find duplicates in sql?

691






What is an intersect?

866


What is sql used for?

856


How many types of primary keys are there?

711


Can instead of triggers be used to fire once for each statement on a view?

716


what is the difference between primary key and unique key? : Sql dba

708


why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba

791


Can a foreign key be a duplicate?

684


What is equi join in sql?

799


what is the difference between ereg_replace() and eregi_replace()? : Sql dba

769


Can ddl statements be used in pl/sql?

795