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: How do I know if a table exists?

Re: How do I know if a table exists?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Thu, 21 Mar 2002 20:36:50 +0000
Message-ID: <3C9A4462.CCB@yahoo.com>


Robert H. Oujesky wrote:
>
> True, and that is what I am doing now. I just don't want users getting
> tense watching error messages scroll by. I am doing this for several tables
> and the user (Geologist, not computer literate...) is actually kicking this
> off automatically.
>
> Thanx
>
> "TurkBear" <jgreco1_at_mn.rr.com> wrote in message
> news:qr2k9uspmdn8lomi34bms69alk0a542r53_at_4ax.com...
> >
> > Unless you really need to know, just drop it..the error about the table
> not existing will not stop your script..
> >
> >
> > "Robert H. Oujesky" <roujesky_at_neuralog.com> wrote:
> >
> > >I am running a script in SQLPlus. If the table exists, I want to drop it
> > >and then re-create it. I just don't know the syntax for checking the
> > >existance of a table....
> > >
> > >Thanx
> > >
> >
> >
> >
> > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> > Check out our new Unlimited Server. No Download or Time Limits!
> > -----== Over 80,000 Newsgroups - 19 Different Servers! ==-----

begin
  execute immediate 'drop table blah';
exception when others then
  if sqlcode = -942 then null; else raise; end if; end;

or thereabouts

hth
connor

-- 
==============================
Connor McDonald

http://www.oracledba.co.uk

"Some days you're the pigeon, some days you're the statue..."
Received on Thu Mar 21 2002 - 14:36:50 CST

Original text of this message

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