Subject Re: [firebird-support] Transactional Commands in Stored procedures.
Author Doug Chamberlin
At 7/21/2003 11:15 AM (Monday), Mahesh Ishwar wrote:
>I understand why DDL statements are not allowed [in stored procedures],
>but couldn''t get the reasons for not allowing Begin Transaction, End
>transaction, commit, etc.
>Can anyone tell me why this is so..?

With Interbase and Firebird stored procedures and triggers are executed
WITHIN the context of a transaction. Unlike with other RDBMS systems,
triggers are not scripts, but procedures which are invoked by the server at
the appropriate time within the transaction which caused them to be invoked.

Having it this way allows the containing transaction to easily commit or
rollback all the effects of the triggers. If the triggers were allowed to
create their own transactions how would you deal with rolling back their
effects when you needed to?

If you have a client-side scripting application it can call stored
procedures, as needed, within several consecutive transactions using the
EXECUTE PROCEDURE statement. However, the server itself does not execute