Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: dropping a table, if it exists?
Why not just issue the DROP TABLE command? If the table exists, it will be dropped. If it doesn't exist, then you'll just get a harmless error message which you can ignore.
HTH,
Brian
Hope wrote:
>
> hi-
>
> I am trying to test to see if a table exists, and then drop it. I
> would have thought that
>
> drop table advsearch
> where exists (select * from user_tables where
> table_name='ADVSEARCH';);
>
> would work, but it doesn't.
>
> I have also tried
>
> BEGIN
> drop table ADVSEARCH;
> create table ADVSEARCH ( testfield number );
> EXCEPTION
> create table ADVSEARCH (testfield number);
> END;
>
> to no avail. Please please help?
>
> gratefully,
>
> Hope
-- ======================================== Brian Peasland Raytheons Systems at USGS EROS Data Center These opinions are my own and do not necessarily reflect the opinions of my company! ========================================Received on Wed Jan 31 2001 - 09:50:16 CST
![]() |
![]() |