Oracle自定义例外

--自定义例外
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;

posted on 2015-07-12 14:34  小雪狐之kiss  阅读(169)  评论(0编辑  收藏  举报