服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > 数据库技术 > Oracle技术 > Oracle开发 > 查看文档

轻松掌握oralce数据库常用预定义的例外

【赛迪网-it技术报道】oralce数据库常用预定义例外:

exception

when cursor_already_open then-- ora-06511 sqlcode = -6511 游标已经打开

when dup_val_on_index then

-- ora-00001 sqlcode = -1 向唯一索引中插入重复数据

when invalid_cursor then

-- ora-01001 sqlcode = -1001 非法游标操作

when invalid_number then-- ora-01722 sqlcode = -1722 字符向数字转换失败

when login_denied then

-- ora-01017 sqlcode = -1017

when no_data_found then

-- ora-01403 sqlcode = +100 没有找到数据

when not_logged_on then

-- ora-01012 sqlcode = -1012

when program_error then

-- ora-06501 sqlcode = -6501 程序错误

when storage_error then

-- ora-06500 sqlcode = -6500

when timeout_on_resource then

-- ora-00051 sqlcode = -51

when too_many_rows then-- ora-01422 sqlcode = -1422 返回多行

when transaction_backed_out then

-- ora-00061 sqlcode = -61

when value_error then

-- ora-06502 sqlcode = -6502 数值转换错误

when zero_divide then

-- ora-01476 sqlcode = -1476 被零除

when others then-- 其它任何错误的处理

end;

--用户定义的例外

declare

find_data_emp exception;

begin

if ... then

raise find_data_emp;

end if;

exception

when lob_no_locked then

...

end;

扫描关注微信公众号