raise_application_error:
create or replace trigger test_trigger
before insert or update or delete
ontest
begin
raise_application_error('-20002', 'you can not change the data !');
end;
create procedure myPro(mun int,outPam out varchar2)
is
begin
select name from myTable where id = num into outPam;
Exception
raise_application_error('-20002', 'you can not change the data !');
end;
本文将介绍如何在SQL脚本中使用raise_application_error函数来处理自定义的应用错误,包括触发器和存储过程中的错误场景。通过实例演示如何在特定操作失败时抛出错误并提供错误消息。
899

被折叠的 条评论
为什么被折叠?



