Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Check table existance
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