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: Test for the exsistance of a table

Re: Test for the exsistance of a table

From: Ryan Gaffuri <rkg100_at_erols.com>
Date: 8 Mar 2002 11:21:51 -0800
Message-ID: <6757365f.0203081121.1e8152a3@posting.google.com>


SELECT TABLE_NAME

FROM      DBA_TABLES
WHERE     TABLE_NAME ='<MY TABLE>';

Oracle maintains a series of data dictionary views that will tell you all the information you will need about what is in the database. They come in 3 types.. USER_(only what the current user owns), ALL_(everything), DBA_(more info pertinent to a DBA).

SELECT VIEW_NAME
FROM ALL_VIEWS
WHERE VIEW_NAME LIKE 'DBA_%'; There are some more DBA views than other types, but for most of them you can replace DBA_nameofview with USER_ or ALL_ Some DBA views have extra columns.

"Philip Morrow" <cracker_at_mymorrow.com> wrote in message news:<3c5i8.78860$TV4.13070960_at_typhoon.tampabay.rr.com>...
> Is there a way to test for the exsistance of a table with SQL code. I need
> to test to see if a table exsists and if so drop it. If it doesn't the drop
> table statement doesn't need to be executed.
>
> Thanks for the help.
>
> Phil
Received on Fri Mar 08 2002 - 13:21:51 CST

Original text of this message

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