当前位置:Gxlcms > 数据库问题 > Oracle自定义例外

Oracle自定义例外

时间:2021-07-01 10:21:17 帮助过:47人阅读

--自定义例外
create or replace procedure ex_text(spNo number) is
--定义一个例外
myex exception;
begin
--更新用户sal
update emp set sal=sal+1000 where empno=spNo;
--sql%notfound表示没有更新
--raise myex表示触发myex
if sql%notfound then
raise myex;
end if;
exception
when myex then
dbms_output.put_line(‘没有更新任何用户‘);
end;

Oracle自定义例外

标签:

人气教程排行