|Subject||Re: [firebird-support] Store Procedure for updating data, why it is need to commit?|
> Hi guys,Yes.
> I have a simple stored procedure to update data, like this :
> SET TERM ^ ;
> CREATE PROCEDURE REG
> UPDATE table a set a.field1 = '123';
> SET TERM ; ^
> 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
> I rarely use store procedure to do update / insert / delete, but is this
> a normal behavior?
> Is there any commands to add so commit is no needed?You could perform a commit in the procedure (via EXECUTE STATEMENT
'commit'), but it's not a good idea - inside the procedure, you don't
know how much data you are committing (what was left uncommitted from
before calling the procedure).
You could also use autocommit (also not recommended).