Einfacher CURSOR mit Parametern und NULL Werten
Tipp 22
Thema: Cursor
Datenbank-Version: RDBMS 8.x
Erstellt am 07.10.19
Bearbeitet am 07.10.19
SET SERVEROUTPUT ON
DECLARE
CURSOR emp_curs (p_comm IN NUMBER) IS
SELECT * FROM scott.emp
WHERE comm=p_comm OR ( comm is null and p_comm is null);
BEGIN
FOR rec_curs IN emp_curs(0) LOOP
dbms_output.put_line('Name='||rec_curs.ename);
END LOOP;
END;
/
REM Ausgabe:
Name=TURNER