exam questions

Exam 1z0-144 All Questions

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

Exam 1z0-144 topic 1 question 100 discussion

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

View the Exhibit and examine the structure of the AUDIR_CUST table.

Exhibit Missing -
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
Eli93
2 years, 1 month ago
I agree with C, but it would give errors also for the :OLD keyword right? because for the insert statement inside row-level trigger it's accepted only the value for :NEW
upvoted 1 times
...
cf21
3 years, 2 months ago
Selected Answer: C
As CosminCof stated, it should be C.
upvoted 2 times
...
CosminCof
4 years, 11 months ago
C is correct , you cant use commit or rollback in the trigger. The transaction made in trigger is commited by the normal flow of the program that fired the trigger
upvoted 4 times
Pacogas
4 years, 9 months ago
C is not correct, you won't get an error on compilation, you will get the error on runtime.
upvoted 1 times
...
HexaDev
4 years, 6 months ago
C is correct, you can not use DCL statements in side the triggers.
upvoted 1 times
sobrinho
4 years, 5 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 2 times
...
...
...
chamisso
5 years ago
It compiles successfully, but gives an error when the credit limit is updated in the CUSTOMER table because the PRAGMA AUTONOMOUS_TRANSACTION statement should be introduced in the trigger.
upvoted 4 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago