对于ORA-00942的exception 怎么才能对其进行Exception Handle?
我写了一个程序 发现抛出异常后不会到exception的处理块中 哪位大侠能指点一下?
declare
v_code number;
v_msg varchar2(512);
xTableDoesNotExist exception;
pragma exception_init(xTableDoesNotExist, -942);
begin
insert into ad values ('df');
exception
when xTableDoesNotExist then
v_code:=SQLCODE;
v_msg:=SQLERRM;
dbms_output.put_line('错误信息: id='||v_code||' message='||v_msg);
end;
我写了一个程序 发现抛出异常后不会到exception的处理块中 哪位大侠能指点一下?
declare
v_code number;
v_msg varchar2(512);
xTableDoesNotExist exception;
pragma exception_init(xTableDoesNotExist, -942);
begin
insert into ad values ('df');
exception
when xTableDoesNotExist then
v_code:=SQLCODE;
v_msg:=SQLERRM;
dbms_output.put_line('错误信息: id='||v_code||' message='||v_msg);
end;
WHEN OTHERS THEN
v_code:=SQLCODE;
v_msg:=SQLERRM;
dbms_output.put_line('错误信息: id='||v_code||' message='||v_msg);