Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Test for the exsistance of a table
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