Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Checking for table existance
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