troubleshooting Question

How to check if a database objects exist before creating a new one in Oracle?

Avatar of IT_ETL
IT_ETL asked on
Oracle DatabaseSQL
15 Comments1 Solution5836 ViewsLast Modified:
Is there any similar sql statement in Oracle just like one below in SQL Server?

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BU_STATE]') and OBJECTPROPERTY(id, N'IsTable') = 1)
drop table [dbo].[BU_STATE]

If so then please advise.

Basically, I like to run a sql statement to drop a table or any database objects (for example function, procedure, view, package) if it exists in Oracle Database. If database objects do not exist then sql statement will run without any error.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 15 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros