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

Home -> Community -> Usenet -> c.d.o.misc -> Is there an equivalent to the SQL Server "if exists" statement?

Is there an equivalent to the SQL Server "if exists" statement?

From: Franklin Bowen <FBowen_at_my-dejanews.com>
Date: Fri, 09 Jul 1999 09:39:14 -0400
Message-ID: <3785FB82.58F9FB07@my-deja.com>


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

Original text of this message

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