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: PL/SQL exceptions for missing table?

Re: PL/SQL exceptions for missing table?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 05 May 1998 01:10:05 GMT
Message-ID: <354e6652.2559310@192.86.155.100>


A copy of this was sent to rtmd30_at_email.sps.mot.com (Greg Ferguson) (if that email address didn't require changing) On Mon, 04 May 1998 15:58:34 -0700, you wrote:

>Hi,
>
>I looked in the Oracle book, but didn't see an exception that'd be raised
>if I tried to do a select...into with a non-existing table.
>
>I'm trying to handle a case where my code is first run, and its private
>table hasn't been initialized.
>
>Is there a way to handle this condition?
>
>Thanks,
>
>Greg

If you are using 'static' sql in pl/sql, then the block of code (be it a named procedure or anonymous pl/sql block) will never compile -- the code will never execute. You can't catch any exceptions in this case since the code itself never runs.

If you are using dbms_sql, then the call to dbms_sql.parse will throw an exception and sqlcode will be set to -942, Table or view does not exist.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon May 04 1998 - 20:10:05 CDT

Original text of this message

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