exam questions

Exam 1z0-144 All Questions

View all questions & answers for the 1z0-144 exam

Exam 1z0-144 topic 1 question 109 discussion

Actual exam question from Oracle's 1z0-144
Question #: 109
Topic #: 1
[All 1z0-144 Questions]

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
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Aditya
3 years, 2 months ago
D is correct
upvoted 1 times
...
HexaDev
4 years, 10 months ago
correct: C. It gives an error on compilation because of the commit command in the trigger code. We can not use DCL statements in side the Triggers.
upvoted 2 times
sobrinho
4 years, 9 months ago
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
...
...
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.

SaveCancel
Loading ...