【发布时间】:2016-08-12 03:43:28
【问题描述】:
我想处理ORA-000942 的异常,我正在关注这个manual 和这个discussion。由于这是一个没有预定义名称的ORA- 错误,我想使用exception_init.
当我运行此代码时,我继续收到 ORA-000942 消息,但不是通过过程级处理程序获得的预期结果。
create table foobar (foobar_id varchar(1));
declare
procedure p_add_to_foobar
is
p_missing_table exception;
pragma exception_init(p_missing_table, -00942);
begin
insert into foobaz
select '1' from dual;
exception
when p_missing_table then
dbms_output.put_line('MISSING TABLE');
end p_add_to_foobar;
begin
p_add_to_foobar;
dbms_output.put_line('DONE');
end;
问题:
- 如何让我的过程级异常来处理 -942 错误?
【问题讨论】:
标签: oracle plsql oracle11g exception-handling