create or replace procedure myproc as
cursor c1 is select a from b;
e_DB2_error EXCEPTION;
PRAGMA EXCEPTION_INIT (e_DB2_error, -9100);
x varchar2(100);
begin
open c1;
begin
fetch c1 into x;
exception
WHEN e_DB2_error THEN
dbms_output.put_line('edb2error before loop');
end;
while c1%found loop
begin
fetch c1 into x;
exception
WHEN e_DB2_error THEN
dbms_output.put_line('db2error in loop');
end;
end loop;
close c1;
end;
/