QUESTION: 12

On 20 de July de 2007, in 1Z0-001, OCA (PL/SQL Developer), ORACLE, by Fabiano Anjos

Which statement is true when writing a cursor FOR-LOOP?

A: You must explicitly FETCH the rows within a cursor FOR-LOOP.
B: You must explicitly OPEN the cursor prior to the cursor FOR-LOOP.
C: You must explicitly CLOSE the cursor prior to the end of program.
D: You do not explicitly OPEN, FETCH or CLOSE a cursor within a cursor FOR-LOOP.
E: You must explicitly declare the record variable that holds the row returned from the cursor.

ANSWER: A

EXPLANATION: Answer D is correct because when using a cursor FOR-LOOP you don’t need explicitly OPEN, FETCH or CLOSE a cursor (by definition of a cursor FOR-LOOP).

INCORRECT ANSWERS:

A: You don’t need explicitly FETCH the cursor within a cursor FOR-LOOP.
B: You don’t need explicitly OPEN the cursor within a cursor FOR-LOOP.
C: You don’t need explicitly CLOSE the cursor within a cursor FOR-LOOP.
E: You don’t need to declare the record variable to hold the row from the cursor if you use a cursor FOR-LOOP.

 

Comments are closed.