In this tutorial, you’ve learned how to use PL/SQL Cursor to loop through a set of rows with all necessary steps that need to be done including DECLARE, OPEN, FETCH and CLOSE. Returns TRUEif the cursor cursor_nameis open Returns the number of records fetched from the cursor cursor_nameat the time we test %ROWCOUNT attribute Returns TRUEif record was not fetched successfully by cursor cursor_name Returns TRUEif record was fetched successfully by cursor cursor_name These are the main attributes of a PL/SQL cursor and their descriptions. Code language: SQL (Structured Query Language) ( sql ) PL/SQL Cursor Attributes To be more specific: the first one should store tables with a specific prefix in it. I´m trying to define Nested Cursors, which means that the output from the first Cursor should be the input for the second. fetch information from cursor into recordĭBMS_OUTPUT.PUT_LINE(r_partment_name || ' - ' || Ask Question Asked 7 years, 10 months ago. INNER JOIN departments d ON d.manager_id = e.employee_id Here is an example of declaring a cursor:ĭECLARE - declare a cursor CURSOR cur_chief IS SELECT first_name, This part is optional so you can omit it in the CURSOR declaration.