Subject Re: [firebird-support] Commit in execute block?
Author Mark Rotteveel
On 29-3-2017 11:37, jonatan.lauritsen@... [firebird-support] wrote:
> I am using Firebird 3 and I need to write one execute block statement
> which makes several alter table and update table commands, like:
>
> execute statement 'alter table accounts add balance double precision'
> execute statement 'update accounts set balance=previous_balance+10'
> etc.
>
> The problem is that commit is required after alter table (before the new
> field can be used in update command). The question - how can I issue
> some kind of commit inside execute block?
>
> I am required to write multiple commands in one block, so, I can not
> separate statements.

Why? Just like with stored procedures, you shouldn't be doing DDL from
execute block.

Mark
--
Mark Rotteveel