Q:
What is a Trigger? Explain Types of PL/SQL Triggers.
Answer
A database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database. The trigger is mostly used for maintaining the integrity of the information on the database.
Syntax:
CREATE OR REPLACE TRIGGER [Trigger Name] [Before / After / Instead Of]
ON [schema].[table]
<PL/SQL subprogram>
Types of PL/SQL triggers :
> Row trigger - The trigger fires for each ROW affected.
> Statement trigger - The trigger is fired once when the condition is matched
> Before and After trigger - The BEFORE trigger run the trigger action before the insert, update or delete statement. The AFTER trigger runs the trigger action after the insert, update or delete statement is executes.
View answer
Workspace
Report Error
Discuss