Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Is there an equivalent to the SQL Server "if exists" statement?
In SQL Server one can do this:
if exists (select * from sysobjects where id = object_id('dbo.x') and sysstat & 0xf = 3)
drop table dbo.x
to drop a table only if it exists. I want to do the same thing in Oracle SQL (*NOT* PL/SQL) if possible.
I have to make sure the table doesn't exist before doing other operations. I could just put in the drop and let it fail if the table doesn't exist but clients tend to panic when they see ANY type of error.
Thanks! Received on Fri Jul 09 1999 - 08:39:14 CDT
![]() |
![]() |