Subject Re: [firebird-support] How to drop an procedure only if exists...
Author Lucas Franzen
adrian_avila_mtz schrieb:
> I have an update script to be aplied automatic that need to drop a
> procedure, some of the DB have the procedure named 'UTIL01' if the
> procedure exists there is no problem, but if it doesn't exists it gets
> an error and since the update must be clean and automatic I need to
> used the drop procedure sentence only if the procedure exists to don't
> get the error in the update.
>
> Any ideas?

You can check the RDB$PROCEDURES table to see if the stroed proc is there.

If you use Firebird you can also use the CREATE OR ALTER PROCEDURE
command to first create the procedure (if it does exist it will be
altered) and then drop it.

Luc.