Answered Questions

  • Retriving Multiple Records

    Why PL/SQL does not support retriving multiple records?

    Star Read Best Answer

    Editorial / Best Answer

    promisinganuj  

    • Member Since Sep-2009 | Sep 13th, 2009


    Retriving multiple records is a basic feature of SQL where we fetch the data using SELECT statement.
    SELECT *
      FROM emp;
    This itself gives us multiple records. There is no additional feature required to do the same in PL/SQL.
    At the same time, PL/SQL goes one step further and enable us to process these fetched rows one by one (unlike the update statements which updates all the rows selected).
    There are several options for fethcing data in different PL/SQL constructs:
    1. Using Ordinary Cursor
    2. Using Ref Cursor
    3. Using PL/SQL bulk collect
    4. Using PL/SQL arrays

    But the important thing here is that irrespective of the way we fetch the data, we act upon them row-by-row.