--测试自定义异常
 
create or replace package body exception_test_pkg is


exp_difin_error exception;
g_msg_data varchar2(2000);

procedure test(p1 in number, p2 in number) is
begin
if p1 > p2 then
g_msg_data := 'p1大于p2';
raise exp_difin_error;

end if;
end;

procedure main(p1 in number, p2 in number) is
begin

test(p1, p2);

exception
when exp_difin_error then
raise_application_error(-20001, g_msg_data || '; ' || SQLERRM);
END;

end exception_test_pkg;

 

相关文章:

  • 2021-07-08
猜你喜欢
  • 2021-08-20
  • 2021-04-05
  • 2021-12-13
  • 2021-07-30
  • 2021-12-19
  • 2021-12-13
  • 2021-12-18
相关资源
相似解决方案