Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle : IF Exists
Hi
The most common way is to select from all_objects, all_tables, all_views. See the description of these views in the manual. They all map to Oracle's so-called data dictionary, which hold the medata about objects in the database.
The faster way will be to attempt the operation on the table and intercept the exception of ORA-942. To do it, you will need to enclose executed code into BEGIN..EXCEPTION...END block and possibly to define an exception with EXCEPTION_INIT. See your PLSQL guide for more information.
holth_at_my-deja.com wrote:
> Hi
> I Need some way to confirm if a table exists or not.
> In MS SQL i used the function IF EXISTS. What is the equivalent to this
> in Oracle??
> Thanks for any help
> Lars
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Oct 20 2000 - 08:44:48 CDT