What is a trigger? Explain the working of BEFORE and AFTER triggers.
What will be an ideal response?
A database trigger, known simply as a trigger, is a PL/SQL block. It is stored in the
database and is called automatically when a triggering event occurs. A user cannot call a trigger explicitly. The triggering event is based on a Data Manipulation Language statement such as INSERT, UPDATE, or DELETE. A trigger can be created to fire before or after the triggering event. The BEFORE trigger is fired before execution of a DML statement. The BEFORE trigger
is useful when you want to plug in some values in a new row, to insert a calculated column into a new row, or to validate a value in the INSERT query with a lookup in another table. An AFTER trigger fires after a DML statement is executed. It utilizes the built-in Boolean functions INSERTING, UPDATING, and DELETING. If the triggering event is one of the three DML statements, the function related to the DML statement returns TRUE and the other two return FALSE. For example, if the current DML statement is INSERT, then INSERTING returns TRUE, but DELETING and UPDATING return FALSE.
You might also like to view...
In programming, combining two strings a and b into a single string ab is called ____ the strings.
A. adding B. concatenating C. merging D. joining
To insert a int key and string value to map1, use _________.
a. map1.insert(100, "John Smith");
b. map1.insert(map
If the wireless device is configured for DHCP yet no DHCP server is active, then Windows assigns a(n) ____________________ IP Addressingaddress that begins with the IP range 169.254.x.x.
Fill in the blank(s) with the appropriate word(s).
Lines indicate the outline of a text box as it is drawn
Indicate whether the statement is true or false