Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: whenever sqlerror is an unknown statement?
Thanks! But it doesn't work:
declare x varchar(20);
begin
select id into x from pass where id = '1';
exception
when others then
if sqlcode = -942 then
execute immediate 'create table pass(a char(10));';
end if;
end;
Gives ORA-06550: line 4, column 23: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 4, column 1: PL/SQL: SQL Statement ignored. So it's not catching any 'others', and it's not creating the table (I know because the same thing happens if I run it again). What's wrong?
Thanks again,
John Received on Wed Jan 25 2006 - 12:14:03 CST
![]() |
![]() |