Subject | Re: [firebird-support] Re: How to drop stored procedure from another stored procedure ? |
---|---|
Author | Helen Borrie |
Post date | 2007-09-08T07:21:47Z |
At 04:56 AM 8/09/2007, you wrote:
misunderstood Milan's advice...the code inside an EXECUTE BLOCK is
like the code inside a s.p. - they are almost interchangeable. Use
EXECUTE BLOCK in dynamic SQL, use CREATE PROCEDURE to create a
permanent s.p. So:
CREATE PROCEDURE DROP_PROC
AS
begin
if (exists(select 1
from RDB$PROCEDURES where RDB$PROCEDURE_NAME = 'PROC'))
then
EXECUTE STATEMENT 'drop procedure PROC';
end
./hb
>Looks well but I get parsing error compiling itYou can't use EXECUTE BLOCK in a stored procedure. You seem to have
>
>Invalid token.
>Dynamic SQL Error.
>SQL error code = -104.
>Token unknown - line 4, column 9.
>BLOCK.
>
>
>CREATE PROCEDURE DROP_PROC
>AS
>begin
> EXECUTE BLOCK
misunderstood Milan's advice...the code inside an EXECUTE BLOCK is
like the code inside a s.p. - they are almost interchangeable. Use
EXECUTE BLOCK in dynamic SQL, use CREATE PROCEDURE to create a
permanent s.p. So:
CREATE PROCEDURE DROP_PROC
AS
begin
if (exists(select 1
from RDB$PROCEDURES where RDB$PROCEDURE_NAME = 'PROC'))
then
EXECUTE STATEMENT 'drop procedure PROC';
end
./hb