您的位置:首页 > 数据库 > Oracle

Oracle自定义例外

2015-07-12 14:34 267 查看
--自定义例外
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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: