View the Exhibit and examine the structure of the AUDIR_CUST table. CUST_ID and CUST_LIMIT are existing columns in the CUSTOMER table. Examine the following trigger code: Which statement is true about the above trigger?
A.
It gives an error on compilation because it should be a statement-level trigger.
B.
It compiles and fires successfully when the credit limit is updated in the customer table.
C.
It gives an error on compilation because of the commit command in the trigger code.
D.
It compiles successfully, but gives an error when the credit limit is updated in the CUSTOMER table because the PRAGMA AUTONOMOUS_TRANSACTION
CREATE TABLE audit_cust (
user_name VARCHAR2(50),
change_time DATE,
cust_id NUMBER,
old_credit_limit NUMBER,
new_credit_limit NUMBER
);
/
Table AUDIT_CUST created.
CREATE OR REPLACE TRIGGER tr_audit_cust AFTER
UPDATE OF salary ON emp1
FOR EACH ROW
BEGIN
INSERT INTO audit_cust (
user_name,
change_time,
cust_id,
old_credit_limit,
new_credit_limit
) VALUES (
user,
sysdate,
:old.employee_id,
:old.salary,
:new.salary
);
COMMIT;
END;
/
Trigger TR_AUDIT_CUST compiled
UPDATE emp1
SET
salary = NULL
WHERE
department_id = '20';
/
ORA-04092: cannot COMMIT in a trigger
ORA-06512: at "HR.TR_AUDIT_CUST", line 16
ORA-04088: error during execution of trigger 'HR.TR_AUDIT_CUST'
D is correct.
upvoted 3 times
...
...
This section is not available anymore. Please use the main Exam Page.1z0-144 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Aditya
3 years, 2 months agoHexaDev
4 years, 10 months agosobrinho
4 years, 9 months ago