Re: PL/SQL: How to check if a table exists or not?

From: Gary England <gengland_at_hiwaay.net>
Date: 1997/09/09
Message-ID: <34160693.2385_at_hiwaay.net>#1/1


Sandra Jones wrote:
>
> greg teets wrote:
> >
> > On Wed, 27 Aug 1997 15:43:33 -0300, "Michael A. Casillas"
> > <casillas_at_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. Received on Tue Sep 09 1997 - 00:00:00 CEST

Original text of this message