Subject Re: [IBO] Ensure table consistency
Author Svein Erling Tysvaer
Hi Jeff!

If you just want to ascertain that all statements sees the same values
throughout your transaction, I think tiConcurrency should be enough. If
others change records (UPDATE/DELETE records that you also try to UPDATE
or DELETE, INSERT isn't affected) while you try to run your update
script, you will get an exception upon commit.

tiConsistency sounds a bit extreme.

Take a look at http://www.ibobjects.com/TechInfo.html#trantutor for more
information about transactions.

HTH,
Set
-donating to Firebirds future development is now easier than it was 24
hours ago. Take a look at the upper left corner of www.firebirdsql.org.

jeffplata wrote:
> In firebird, I have a SP that sums table1 and inserts the totals into
> table2. After this, the SP updates table1 to mark the just finished
> process. In IBO, I use a ib_storedproc to execute the SP. What can I
> do to ensure that table1 will not be updated by other users while the
> SP is doing its thing? Will tiConsistency apply help here? I tried it
> with ib_storedproc but the combo seems incorrect and I just can't get
> it to work.
>
> Actual SP follows:
> [code]
> begin
> delete from postedsls where period>=:aperiod;
>
> insert into postedsls(gl,sl,normbalance,period,bdr,bcr,cdr,ccr,edr,ecr)
> select gl,sl,normbalance,:aperiod,beg_debit,beg_credit,debit,credit,
> end_debit,end_credit
> from view_sl_balance(:aperiod);
>
> update jevs set posted='1' where jevperiod=:aperiod;
> end
> [/code]
>
> TIA.