Subject Re: [IBO] Transactional design with IBO question
Author hcarvajalsy
Thank you Helen. Eliminating the script idea then the criteria is to
embody as much as possible in stored procedures. Thus, a first store
procedure would embody the set of known updates/insert (e.g, catalog
update, log update, etc. - which are certain), plus a 1 or more
calls for the "variable" update/inserts (min 1, but max = number of
elements to insert). Is is reasonable to visualize the "algorithm"
as described below?

try
TIB_Script.IB_Connection := TIB_Connection;
TIB_Script.IB_Transaction :=TIB_Transaction;
if not TIB_Transaction.TransactionIsActive
then TIB_Transaction.StartTransaction;

/* 1 stored procedure for all operations which are "fixed" */
IB_DSQL.SQL.Clear;
IB_DSQL.SQL := 'Execute SP_Fixed_Ops(Arg1, Arg2, ...)'
IB_DSQL.ExecSQL;

/* 1 call for each item, since it is a variable number of
items (e.g., N items)*/
IB_DSQL.SQL.Clear;
IB_DSQL.SQL := 'Execute SP_Item(Item1, Arg1, Arg2, ...)'
IB_DSQL.ExecSQL;

IB_DSQL.SQL.Clear;
IB_DSQL.SQL := 'Execute SP_Item(Item2, Arg1, Arg2, ...)'
IB_DSQL.ExecSQL;
...
IB_DSQL.SQL.Clear;
IB_DSQL.SQL := 'Execute SP_Item(ItemN, Arg1, Arg2, ...)'
IB_DSQL.ExecSQL;

TIB_Transaction.Commit;
except
TIB_Transaction.RollBack;
end;

Sorry to make it sound like a recipee, but I am trying to have the
right procedural model. Thank again.
Regards,
Horacio