Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Checking for table existance

Re: Checking for table existance

From: <mpir_at_compuserve.com>
Date: Wed, 22 Apr 1998 08:49:46 -0600
Message-ID: <6hkshq$80p$1@nnrp1.dejanews.com>


As a variant:

Select 'It Lives' Search from all_tables where table_name='TABLE' and owner='OWNER';

In article <01bd6d78$944e8980$a51c67d1_at_iosif>,   "Iosif Tanasescu" <a_at_j.smith> wrote:
>
>
> I'd like to check for the existance of a table before I create it
>
> Declare
> Nr integer;
> begin
> Select count(*) into nr
> from all_tables
> where table_name = 'YOUR_TABLE_NAME'
> and owner= 'YOUR_OWNER';
> if nr = 1 then
> dbms_output('I FOUND"IT');
> else
> dbms_output('Not yet created;');
> end if;
> end;
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Wed Apr 22 1998 - 09:49:46 CDT

Original text of this message

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