ITPub博客

首页 > 应用开发 > IT综合 > 用户自定义异常

用户自定义异常

原创 IT综合 作者:hxl 时间:2009-08-14 16:39:27 0 删除 编辑
用户自定义异常[@more@]

create or replace procedure sp_insert_data01
as
j number;
k number;
excp exception;
begin
j:= 10;
k:= 20;
if j <= k then
raise excp;
end if;
for i in 1..1000000 loop
insert into tb_hxl_test
values(i,to_char(i)||chr(i));
end loop;

exception
when excp then
begin
dbms_output.put_line('Error code: ' || sqlcode);
dbms_output.put_line('Error description: ' || sqlerrm);
rollback;
end;
insert into tb_hxl_log values('aa','bb'); -- 测试
commit;
end sp_insert_data01;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/77311/viewspace-1025295/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    29
  • 访问量
    528064