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: Mark C. Stock <mcstockX_at_Xenquery>
Date: Mon, 23 Jan 2006 20:33:13 -0500
Message-ID: <-M2dnYo1D_VBHkjeRVn-gw@comcast.com>

<jjsavage_at_gmail.com> wrote in message
news:1138039070.230535.199500_at_f14g2000cwb.googlegroups.com...
> >BTW: In Oracle one doesn't check the dictionary for existence or
>>non-existence of tables. One traps exceptions.
>
> Which exception do I trap? I've found several lists of exceptions
> thrown, but none of them are the right one.
>
> - John
>

SQL> select *
  2 from thistableisnothere;
from thistableisnothere

     *
ERROR at line 2:
ORA-00942: table or view does not exist

use WHEN OTHERS and check SQLCODE for -942

(and a picky point: exceptions are raised, not thrown)

++ mcs Received on Mon Jan 23 2006 - 19:33:13 CST

Original text of this message

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