Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle : IF Exists
You can do it simpler:
select count(1)
from all_tables
where table_name = 'YOUR_TABLE'
and owner = 'OWNER_NAME';
In article <EdZG5.109$L32.45184_at_wdc-read-01.qwest.net>,
"Mike Dwyer" <dwyermj_at_co,larimer.co.us> wrote:
> if exists (select 1 from all_tables where table_name = 'YOUR_TABLE')
> (if "you" are not the owner of the table, you would also need to
include
> "and owner = 'OWNER_NAME'")
>
> <holth_at_my-deja.com> wrote in message
news:8sguce$10f$1_at_nnrp1.deja.com...
> > Hi
> > I Need some way to confirm if a table exists or not.
> > In MS SQL i used the function IF EXISTS. What is the equivalent to
this
> > in Oracle??
> > Thanks for any help
> > Lars
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Oct 17 2000 - 14:50:45 CDT