Following quiz provides Multiple Choice Questions (MCQs) related to PL/SQL. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz. Show plsql_questions_answers.htm New QuizDatabase triggers – Learn when and how trigger works on database tables. Also Learn their classification and usage in different scenarios with examples Database TriggersTriggers are stored programs containing set of PL-SQL statements , which are automatically executed when ever an DML statement performed on the table. It is a PL-SQL blok like a procedure , to perform some specific task. But a procedure always requires an explicit call for execution , but triggers are executed automatically when any triggering event occurs. It is associated with a Table or View. INSERT, UPDATE, DELETE are considered as triggering events of the database trigger. These events initiate the firing of trigger. The firing of trigger is nothing but the execution of the PL-SQL code associated to that trigger.It is also a Database object. Notes Triggers are, in fact, written to be executed in response to any of the following events –
Triggers can be defined on the table, view, schema, or database with which the event is associated. Advantages
Syntax for Creating Triggers
NOTES Trigger cannot be duplicate trigger name. CREATE [OR REPLACE] TRIGGER trigger_name – Creates or replaces an existing trigger with the trigger_name. WHEN (condition) – This provides a condition for rows for which the trigger would fire. This clause is valid only for row-level triggers. NEW and OLD- refers to the available in DML statements. Valid in row trigger only. NEWOLDINSERTYNUPDATEYYDELETENYThe following points need to be considered here –
Application TriggerIt is fired When DML Event occurs within the Application. Example : Oracle Forms. Database TriggerIt is fired when DML Event occurs on a Table/ View no matter which user is connected. Components of TriggerTrigger PartsIndicates when to activate the trigger. i.e defines whether the trigger first before or after the statement is executed. Which statement is used to create a trigger Mcq?The CREATE TRIGGER statement is used to create the trigger.
Which command is used to create a trigger?Use the CREATE TRIGGER command to create database triggers that fire when a modification or attempted modification to an ObjectServer table occurs (or when a modification or attempted modification to a view affects a base table).
Which trigger execute any action after the triggering statement is executed?An AFTER triggered action executes after the action of the triggering statement is complete.
How many create trigger statement Are there Mcq?Trigger has three parts: Trigger statement or event is the SQL statement that causes a trigger to be fired. Triggering event can be INSERT, DELETE, or UPDATE etc.
|