Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Check table existance

Check table existance

From: Ryan Lubke <Ryan.Lubke_at_East.Sun.COM>
Date: Thu, 18 Jan 2001 18:09:11 -0500
Message-ID: <3A677797.2010703@East.Sun.COM>

Hello,

I would like to be able to check for existence of a table, if it does exist, then I would like to drop that table.

if ( <table_exits )
  drop table <tablename>

So far, I have been unsuccessful in what I've tried.

The following select could work:

SELECT 1 from user_tables where EXISTS ( select TABLE_NAME from

    user_tables where TABLE_NAME = 'test' )

This seems a bit "clunky" from the SQL dialect I'm used to.

Additionally, if I put this select anywhere near an IF statement, I get complaints.

I've search the internet for suggestions and have not found any so, I'm hoping you folks will have one.

Thanks,

Ryan Lubke Received on Thu Jan 18 2001 - 17:09:11 CST

Original text of this message

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