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

Home -> Community -> Usenet -> c.d.o.server -> Re: Ignore ORA 942 Error

Re: Ignore ORA 942 Error

From: Brian Dick <bdick_at_cox.net>
Date: Tue, 12 Oct 2004 12:47:25 -0400
Message-ID: <v150tfytg42d.1pmmg35g5evbc$.dlg@40tude.net>


On Tue, 12 Oct 2004 14:47:45 +0200, Sybrand Bakker wrote:

> On Tue, 12 Oct 2004 07:32:32 -0400, Brian Dick <bdick_at_cox.net> wrote:
> 

>>On 12 Oct 2004 03:07:52 -0700, Neil wrote:
>>
>>> I have a unix script that includes a DROP TABLE and CREATE TABLE
>>> command in SQL Plus.it works fine if the table to drop is there. If
>>> not the script ends. Can anyone advise how I can ignore the
>>> "ORA-00942: table or view does not exist" error and continue to the
>>> next command?
>>
>>Rather than ignore the error, why don't you avoid the error. Query
>>user_tables or dba_tables instead. If the table doesn't exist, then create
>>it. Otherwise, skip the create.
> 
> Why would Oracle have implemented then whenever sqlerror in
> catalog.sql?

No "whenever sqlerror" in my version of catalog.sql (9.2.0.5). But I see it in other installation scripts. Point taken. That's a greate SQLPlus feature. Use it all the time.

Also, while I was looking through some of the other installation *.SQL scripts, I noticed some anonymouse PL/SQL blocks with queries against system tables and IF..THEN logic. Hmmm.. I guess you just can't trust those installation developers to do something only one way. Received on Tue Oct 12 2004 - 11:47:25 CDT

Original text of this message

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