5 Replies Latest reply on Dec 15, 2017 2:46 PM by 4ec521da-6362-4197-92f0-13fd708f0983

    Use of Cursor to display query results

    4ec521da-6362-4197-92f0-13fd708f0983

      Hi All,

      I want to use the below Query & Cursor to Select and hold a record set, then loop through the results and display the the records.

       

      If there's a better what to select and display query results please let me know.

       

      Thank you for your assistance and comments.

       

      ____________________________________________

       

      DECLARE

        CURSOR employees_in_10_cur

        IS

        SELECT *

        FROM employees

        WHERE department_id = 10;

      BEGIN

        FOR employee_rec

        IN employees_in_10_cur

        LOOP

        DBMS_OUTPUT.put_line (

        employee_rec.last_name);

        END LOOP;

      END;