Practice exercise

  • What are the possible reasons that cause the INVALID_CURSOR exception to occur?
    1. Cursor result set has not been fetched.
    2. The cursor does not have parameters.
    3. The value of the %ROWCOUNT attribute has been referenced after closing the cursor.
    4. 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:
    1. Explicit cursors must be used irrespective of the number of records returned by the query.
    2. Cursor FOR loops must be used as it implicitly takes care of OPEN, FETCH, and CLOSE stages.
    3. Cursor data must be fetched as a record.
    4. Use ROWNUM to index the records in the cursor result sets.
  • While processing DMLs as implicit cursors in a PL/SQL executable block, implicit ...

Get Advanced Oracle PL/SQL Developer's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.