DECLARE
CURSOR curs IS
SELECT
empno,
ename,
sal
FROM
emp
WHERE
job = 'SALESMAN';
v_empno emp.empno%TYPE;
v_name emp.ename%TYPE;
v_sal emp.sal%TYPE;
BEGIN
OPEN curs;
LOOP
FETCH curs INTO
v_empno,
v_name,
v_sal;
EXIT WHEN curs%notfound OR curs%notfound IS NULL;
dbms_output.put_line(v_empno
|| ' '
|| v_name
|| ' '
|| v_sal);
dbms_output.put_line('Aktuelle Zeile :' || curs%rowcount);
END LOOP;
dbms_output.put_line('--- Eingelesene Zeilen :' || curs%rowcount);
CLOSE curs;
END;
/