Subject Re: [firebird-support] Store Procedure for updating data, why it is need to commit?
Author Mark Rotteveel
On 28 Apr 2014 22:23:43 -0700, <trskopo@...> wrote:
> I have a simple stored procedure to update data, like this :
> SET TERM ^ ;
> AS
> UPDATE table a set a.field1 = '123';
> exit;
> END^
> SET TERM ; ^

There is no need for a EXIT statement in this stored procedure.

> When I run that procedure on flamerobin with this command:
> execute procedure Reg.
> It runs ok, but without a commit command, the field1 on table won't get
> update.
> I rarely use store procedure to do update / insert / delete, but is
> a normal behavior?

Of course a commit is necessary, the stored procedure runs in the
transaction that executed the stored procedure. As long as that transaction
hasn't been committed, the change is only visible to that transaction. This
is the same as if you had executed the UPDATE without a stored procedure.

> Is there any commands to add so commit is no needed?

If you really want to (but I don't see why you would), you can use `IN