Re: Checkout for table existance: Without use of procedure?

From: Prabhakar Narayanan <n_prabhakar_at_hotmail.com>
Date: Sat, 28 Dec 2002 15:49:03 +0800
Message-ID: <oprh3un1egitkw8s_at_news.i-cable.com>


Hi there

try this statement

select count(*) from user_tables where table_name = 'YOUR TABLE'

if count > 1, then table exists...
if not table is not there..

remember : please use UPPER CASE in your table name if the table is owned by some other user (present in schema and you have access to read it), then use ALL_TABLES instead of USER_TABLES

best regards

N.Prabhakar

On Wed, 18 Dec 2002 20:33:20 -0000, dino.fancellu <dino_at_dinofancellu.comREMOVE>  wrote:

>
> I want to check for the existance of a table, but don't want to have to
> create a procedure to do the checking, i.e.
> I want it to be inline.
>
> In SQL Server I would do this:
>
> IF( NOT EXISTS( SELECT * FROM sysobjects WHERE NAME='Customer' AND
> type='U' ) )
> ...
>
> Is there an equivalent in Oracle?
>
> It must be inline, i.e. please don't point me to the existing pl/sql
> procs.
>
> Thanks.
>
> Dino.
>
>
>

-- 
Prabhakar Narayanan
Received on Sat Dec 28 2002 - 08:49:03 CET

Original text of this message