Professional Documents
Culture Documents
Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.
Section 6 Quiz
(Answer all questions in this section)
1. You want to use explicit cursors to fetch and display all the
countries in a specific region. There are 19 rows in the WF_WORLD_REGIONS table.
You want to use a different region each time the cursor is opened. How many cursors
should you declare? Mark for Review
(1) Points
Correct Correct
p_param := 'ABC';
OPEN c_curs(p_param);
FOR UPDATE
Correct Correct
4. If the rows you attempt to reserve using FOR UPDATE have already
been locked by another session and you use the NOWAIT option, what is the outcome?
Mark for Review
(1) Points
Your rows will override the other user's lock and your block will execute
successfully.
The server will wait until the locks have been released by the other user.
Correct Correct
5. User MARY has locked a row of the EMPLOYEES table. Now, user
SAEED tries to open the following cursor:
CURSOR c IS
SELECT * FROM employees
FOR UPDATE WAIT 5;
What will happen when SAEED's session tries to fetch the row that MARY has locked?
SAEED's session waits for 5 seconds, then SAEED is disconnected from the
database.
SAEED's session waits for 5 seconds, and then raises an exception if MARY has
not unlocked the row. (*)
SAEED's session waits for 5 seconds, then MARY's session is rolled back.
SAEED's session successfully fetches the first 5 rows and then waits
indefinitely to fetch the 6th row.
SAEED's session waits for 5 minutes, and then raises an exception if MARY has
not unlocked the row.
Correct Correct
Section 6 Quiz
(Answer all questions in this section)
6. When must you declare and use an explicit cursor? Mark for
Review
(1) Points
You need to SELECT more than one row from a table. (*)
Correct Correct
7. You must make sure you have the same number of variables in your
INTO statement as you have in your SELECT list. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
TRUE
FALSE (*)
Correct Correct
The EXIT WHEN ... statement should be coded outside the loop.
Multiple cursors can be opened many times, while a single cursor can be
opened only once.
Multiple cursors allow us to fetch rows from two or more related tables
without using a JOIN. (*)
Multiple cursors are the only way to use cursors with parameters.
Multiple cursors improve performance. They are faster than using a single
cursor.
Correct Correct
Section 6 Quiz
(Answer all questions in this section)
11. How many explicit cursors can be declared and used in a single
PL/SQL block? Mark for Review
(1) Points
One or two
Only one
None of these.
Up to eight cursors
Correct Correct
%FOUND
%ISOPEN (*)
%NOTFOUND
%ROWCOUNT
Correct Correct
The FETCH will fail because the structure of v_dept_rec does not match the
structure of the cursor.
To display the salary of an employee, what code should you write at Point A?
emp_record.salary (*)
emp_record.employees.salary
TO_CHAR(salary)
employees.salary
emp_cursor.salary
Correct Correct
employees.salary
emp_curs.salary
emp_rec.salary IN emp_curs
emp_rec.salary (*)
salary
Correct Correct