存过成败有输出

--存过功能,判断存过是否执行成功,没有正常执行完成输出0
create or replace procedure abc(y in out varchar2) is

x varchar2(2000);

begin
x := 'drop table a01';
execute immediate x;
commit;

y := '1';
dbms_output.put_line(y);
exception
when others then
y := '0';
dbms_output.put_line(y);
end;


--验证
declare x varchar2(6);begin abc(x); end;

posted @ 2023-03-15 17:12  llhhhi  阅读(36)  评论(0)    收藏  举报