Answers for "oracle loop cursor"

SQL
4

oracle dynamic cursor for loop example

-- open the cursor and then fetch and count every row
DECLARE
    CURSOR c IS SELECT * FROM emp;
    cursor_count c%ROWTYPE;
    totalrows    NUMBER;
BEGIN
    OPEN c;
    LOOP
        FETCH c INTO cursor_count;
        dbms_output.put_line('names' || cursor_count.ename);
        EXIT WHEN c%NOTFOUND;
        END LOOP;
    totalrows := c%ROWCOUNT;
    dbms_output.put_line('total rows' || totalrows);
END;
Posted by: Guest on April-26-2021
1

for cursor plsql

FOR record_name IN cursor_name
LOOP 
	statement1; 
	statement2; 
	. . . 
END LOOP;
Posted by: Guest on March-09-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language