create or replace procedure aa_test is
exe_exp exception;
exe_exp2 exception;
a number := 1;
b number := 0;
begin
if a <> 0 then
dbms_output.put_line('kaishi ');
end if;
begin
select serv_id into a from ls65_sid.serv_t a where rownum < 1;
exception
when others then
a := 0;
b := 33;
dbms_output.put_line(b);
dbms_output.put_line('yichang');
raise exe_exp;
end;
dbms_output.put_line(b+3);
raise exe_exp2;
exception
when exe_exp then
dbms_output.put_line('2a');
dbms_output.put_line(b+30);
when exe_exp2 then
dbms_output.put_line(b+10);
when others then
dbms_output.put_line('1a');
end ;
这是匿名块。这个用外部的异常变量直接传递。