Subject | Re: [IBO] Transactions and Stored Procedures |
---|---|
Author | Helen Borrie |
Post date | 2006-02-04T05:40:09Z |
At 04:17 PM 4/02/2006, you wrote:
commit until one wants to do so...but it's wrong for this example
code, see correction..
want to handle it.
Helen
>Hello Helen,It's OK, if one wants to commit right then...one does not have to
>
>I take the liberty to complete the transaction handling. Hope Your
>Honour only forgot to do so - and it isn't me who missed something ;-)
commit until one wants to do so...but it's wrong for this example
code, see correction..
>On Fri, 3 Feb 2006 23:47:32 +0000 (UTC), you wrote:IB_Transaction.Commit;
>
> >IB_Temp is a TIB_DSQL, not a TIB_Query.
> >Its IB_Transaction property is set to be IB_Transaction1:
> >
> >var
> > returnval: string;
> > nr: integer;
> >....
> >returnval :=3D '';
> >nr :=3D [ something!! ]
> > with DataModule1.IB_Temp do
> > try
> > if IB_Transaction.InTransaction then
> > IB_Transaction.Commit;
> > SQL.Clear;
> > SQL.Add('execute procedure RS_SETTEMPABSCHLUSS(:Nr)');
> if not IB_Transaction1.Started then
> IB_Transaction1.StartTransaction;
> > Prepare;
> > ParamByName('Nr').AsInteger :=3D Nr;
> > Execute;
> > returnval :=3D FieldByName('Intern').AsString;
>// IB_Transaction1.Commit;
> > exceptIB_Transaction.Rollback; // but only if *that* is how you
> > ...
>// IB_Transaction1.RollBack;
want to handle it.
> > end;Did you figure it out, Christian? :-)
Helen