Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DROP Procedure but Test if exist

Nico van de KampApr 3 2013 — edited Apr 3 2013
Hello,

I'm not a guru on SQL and PL/SQL but the straight forward things I can solve.

But now I want to delete some stored procedures by a SQL script if possible.


This is working fine the first time when I run the install script:
DROP PROCDURE 'procedurename';

But the next time when I execute the script I get a error like "Procedure doesn't exist".

I don't want this error so how can I solve this.
I was thinking about something like:
DROP PROCEDURE IF EXIST 'procedurename';

or
EXECUTE IMMEDIATE 'DROP PROCEDURE procedurename'

But these two are not working.
Is this possible or do I need to build something in PL/SQL?

Nico
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2013
Added on Apr 3 2013
10 comments
6,785 views