DDL is not allowed in PSQL (stored procedures, triggers, execute block), so executing an ALTER TABLE
like this is rejected.
Also SET TERM
is not part of the Firebird statement syntax. It is specific to query tools like isql and FlameRobin, as they use statement terminators like ;
to know when they end of a statement is reached and can be sent to the server. When executing PSQL blocks those tools need to watch for a different statement terminator to prevent them from sending incomplete statements to the server. In the actual Firebird statement syntax ;
is only part of PSQL blocks.
You will need to execute the ALTER TABLE
and the CREATE PROCEDURE
separately without an EXECUTE BLOCK
.