From: Gary England <gengland@hiwaay.net>
Subject: Re: PL/SQL: How to check if a table exists or not?
Date: 1997/09/09
Message-ID: <34160693.2385@hiwaay.net>#1/1
References: <34047555.2D31BB02@icepr.com> <3404a6ca.71115418@news.ececs.uc.edu> <3415F817.7CDF@bellsouth.net>
Reply-To: gengland@hiwaay.net
Newsgroups: comp.databases.oracle.tools,comp.databases.oracle.server,comp.databases.oracle.misc,comp.databases.oracle,comp.database.oracle



Sandra Jones wrote:
> 
> greg teets wrote:
> >
> > On Wed, 27 Aug 1997 15:43:33 -0300, "Michael A. Casillas"
> > <casillas@icepr.com> wrote:
> >
> > You can select against USER_TABLES
> >
> > Greg in Cincinnati
> > >Yet another one:
> > >
> > >How can I check in PL/SQL if a table exists or not.  Is there a built in
> > >function that can return TRUE or FALSE?  I know the table name, I just
> > >want to know if it's there or if I have to create it.  Thanks in
> > >advance.
> > >
> > >Michael Casillas
> > >
> If you know the name of the table, why not just you
> use
> describe table_name;
> 
> if the table exist it will be described
> 
> sincerely,
> 
> fred jones

This question has been making the rounds.  ORACLE has a built in set of
system tables one of which is USER_TABLES.  

SELECT 'Y' FROM USER_TABLES WHERE TABLE_NAME = 'mytable'

Remember that literals are case-sensitive.


