What happens when you try to update a salary value in the EMP table?

You have a row level BEFORE UPDATE trigger on the EMP table. This trigger contains a
SELECT statement on the EMP table to ensure that the new salary value falls within the minimum
and maximum salary for a given job title.
What happens when you try to update a salary value in the EMP table?

You have a row level BEFORE UPDATE trigger on the EMP table. This trigger contains a
SELECT statement on the EMP table to ensure that the new salary value falls within the minimum
and maximum salary for a given job title.
What happens when you try to update a salary value in the EMP table?

A.
The trigger fires successfully.

B.
The trigger fails because it needs to be a row level AFTER UPDATE trigger.

C.
The trigger fails because a SELECT statement on the table being updated is not allowed.

D.
The trigger fails because you cannot use the minimum and maximum functions in a BEFORE
UPDATE trigger.

Explanation:
This will result in a mutating table. A mutating table is a table against which a data manipulation
statement has been issued and the corresponding trigger on the DML statement is reading from
the same table, at the same time. To work around this you would need to need to create a
statement level trigger with the SELECT statement and place the values into the package
variables. Then the ROW Level Trigger could check the values in the package variables.



Leave a Reply 0

Your email address will not be published. Required fields are marked *