Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: whenever sqlerror is an unknown statement?

Re: whenever sqlerror is an unknown statement?

From: <jjsavage_at_gmail.com>
Date: 25 Jan 2006 10:14:03 -0800
Message-ID: <1138212843.470506.221480@f14g2000cwb.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US