ITPub博客

首页 > 数据库 > Oracle > 获取oracle exception vs errors;sqlcode sqlerrm使用

获取oracle exception vs errors;sqlcode sqlerrm使用

原创 Oracle 作者:polestar123 时间:2009-03-20 11:22:14 0 删除 编辑

create table errors (code number,message varchar2(1000))
truncate table errors;

--测试用

DECLARE
msg CHAR(1000);
BEGIN
FOR num IN 1..100000 LOOP
msg := SQLERRM(-num); -- should be SQLERRM(-num)
if INSTR(msg,'not found',1) > 0 then
null;
else
if INSTR(msg,'non-ORACLE',1) > 0 then
null;
else

INSERT INTO errors VALUES (num,msg);
end if;
end if ;
END LOOP;
commit;
END;

[@more@]

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

上一篇: oracle9i所有文档
请登录后发表评论 登录
全部评论

注册时间:2009-05-22

  • 博文量
    110
  • 访问量
    438369