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: <coffe_at_NOSPAM.pegasystems.com>
Date: 22 Apr 1998 16:03:18 GMT
Message-ID: <6hl4c6$4r4$2@news3.tufts.edu>


Let me correct myself. I have no problem checking for the existance of a table, (select * from user_tables where table_name="Whatever"), it's causing the actual creation of the table once I've found it, PL/SQL reserves the create command for the creation of procedures...

thanks for your help,
erica

mpir_at_compuserve.com wrote:
: 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 - 11:03:18 CDT

Original text of this message

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