PL/SQL Transactions   «Prev  Next»

 

PL/SQL Lock Timer - Quiz

Concepts and Syntax for Locks

Each question is worth one point. Select the best answer or answers for each question.

1. Which problems are resolved by using explicit locks (versus implicit locks)?
Please select the best answer.
  A. Errors in data integrity caused by partial updates
  B. Updates to tables by unauthorized users
  C. Long waits while other users complete updates
  D. Entire transactions rolled back when one part fails

2. Which two commands lock rows you wish to update?
Please select all the correct answers.
  A. CURSOR … FOR UPDATE…
  B. SAVEPOINT UPDATE_ROWS
  C. LOCK TABLE IN EXCLUSIVE MODE
  D. UPDATE PRODUCT…

3. Review the following PL/SQL code. Which line contains a syntax error?
1 CURSOR PRODUCTS IS
2 SELECT PRODUCT_ID, STORE_COST
3 FROM PRODUCT
4 WHERE LAST_UPDATE_DATE > ’01-JUL-99’
5 FOR UPDATE OF PRODUCT TABLE;

Please select the best answer.
  A. 1
  B. 2
  C. 4
  D. 5

4. Which command does not cause some or all of your transaction’s locks to be released?
Please select the best answer.
  A. ROLLBACK TO SAVEPOINT_1;
  B. COMMIT;
  C. CREATE INDEX NEW_IX ON PRODUCT (PRODUCT_NAME);
  D. UPDATE PRODUCT SET LAST_UPDATE_DATE = SYSDATE;