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: Oracle : IF Exists

Re: Oracle : IF Exists

From: Karen <karen.abgarian_at_fmr.com>
Date: Fri, 20 Oct 2000 09:44:48 -0400
Message-ID: <39F04C50.A92BE3D4@fmr.com>

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

Original text of this message

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