BEGIN
<< block_1 >> ------------------------------- Block 1 ---------
DECLARE BEGIN
dbms_output.enable(10000);
<< block_2 >> ---------------------------- Block 2 ---------
DECLARE
v_sal emp.sal%TYPE;
BEGIN
SELECT sal
INTO v_sal
FROM emp
WHERE empno = 10000;
EXCEPTION
WHEN zero_divide THEN
dbms_output.put_line('Fehler in Block_2');
dbms_output.put_line('Fehlertext :' || sqlerrm);
END block_2;
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('Fehler in Block_1');
dbms_output.put_line('Fehlertext :' || sqlerrm);
END block_1;
END;
/
ergebnis :fehler in block_1 fehlertext :ora - 01403 :keine daten gefunden