Which two statements are true about the usage of the cursor for loops?

Which two statements are true about the usage of the cursor for loops? (Choose two.)

Which two statements are true about the usage of the cursor for loops? (Choose two.)

A.
The cursor needs to be closed after the iteration is complete.

B.
The implicit open, fetch, exit, and close of the cursor happen.

C.
The record type must be explicitly declared to control the loop.

D.
The PL/SQL creates a record variable with the fields corresponding to the columns of the cursor result set.



Leave a Reply 6

Your email address will not be published. Required fields are marked *


Naj

Naj

Can anyone please explain

Ahmed

Ahmed

Can anyone please explain D?

Uladzimir

Uladzimir

You don’t need to create record explicitly. Oracle will create it implicitly.

Example:

Begin
For dual_record in (select * from dual) Loop
dbms_output.put_line(’11’);
end Loop;
end;

it works, but dual_record wasn’t declared by programmer, it was done by Oracle implicitly.
Also open, fetch, exit, and close of the cursor were done implicitly

Compare explicit cursor usage:
http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/static.htm#LNPLS006

and For loop cursor:
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/cursor_for_loop_statement.htm#LNPLS1155

Google

Google

Always a major fan of linking to bloggers that I really like but do not get lots of link love from.