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 -> Conditionally dropping tables in script

Conditionally dropping tables in script

From: Simon Picken <simonp_at_tesseract.co.uk>
Date: 1 Aug 2002 05:20:00 -0700
Message-ID: <260f35b8.0208010420.5f98de69@posting.google.com>


Hi,

Is there a way of detecting the existance of a table in Oracle and conditionally dropping it? In Transact SQL I can do the following:

IF EXISTS (
    SELECT * FROM sysobjects WHERE id = object_id('<table name>')     AND sysstat & 0xf = 3
)

    DROP TABLE <table name>
GO

Is there an Oracle equivalent?

Regards,
Simon. Received on Thu Aug 01 2002 - 07:20:00 CDT

Original text of this message

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