Subject Re: [firebird-support] How to drop stored procedure from another stored procedure ?
Author Martijn Tonies
Hi,

> Let's say I don't know is there in the database such procedure as PROC.
I'd like to check it and if it is there to drop it. I tried something like
this but I got "Parsing error"
>
> begin
> select count(*) from RDB$PROCEDURES where RDB$PROCEDURE_NAME = 'PROC'
> into :OK;
> if (:OK = 1) then
> begin
> DROP PROCEDURE PROC;
> end
> end

Is this an anonymous block of code? If so, Firebird doesn't support it.

Firebird 2 supports EXECUTE BLOCK that might help to do this,
check the Release Notes.

> BTW
> DROP PROCEDURE PROC
> is the same as
> delete from RDB$PROCEDURES where RDB$PROCEDURE_NAME = 'PROC' ??

No, not at all!

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com