Practice exercise
What are the possible reasons that cause the
INVALID_CURSORexception to occur?The cursor result set has not been fetched.
The cursor does not have parameters.
The value of the
%ROWCOUNTattribute has been referenced after closing the cursor.The cursor result set has been fetched into a non matching variable.
Identify the guidelines to be considered when designing cursors in a PL/SQL block:
Explicit cursors must be used irrespective of the number of records returned by the query.
Cursor
FORloops must be used as it implicitly takes care of theOPEN,FETCH, andCLOSEstages.Cursor data must be fetched as a record.
Use
ROWNUMto index the records in the cursor result sets.
While processing DMLs as implicit cursors in the PL/SQL executable block, implicit cursor attributes can be used anywhere in the block.
True
False
From the following, identify the two correct statements about the
REFCURSORtypes:Ref cursors are reference pointers to cursor objects
REFCURSORtypes can be declared...