Re: Theoretical Basis for SELECT FOR UPDATE

From: vc <boston103_at_hotmail.com>
Date: 4 Oct 2005 07:31:40 -0700
Message-ID: <1128436300.581016.33860_at_f14g2000cwb.googlegroups.com>


Tony Andrews wrote:
> peter.koch.larsen_at_gmail.com wrote:
> > Tony Andrews skrev:
> > > The TTM version would make it impossible to print the intermediate
> > > total (which would be 10 higher than it should be).
> >
> > Would it now?
> >
> > update account set bal=bal+10 where ac_no=123,
> > call print_total_balance_for_all_accounts,
> > update account set bal=bal-10 where ac_no=456;
> >
> > (Notice commas have replaced semicolons).
>
> Yes, it would: your syntax is not valid. The commas are not merely an
> syntactic alternative to semi-colons, they are semantically different
> too: they indicate that the two updates are to be treated as a single
> DML statement with no implicit ordering. You can't insert a call to
> procedure between the two updates - that is the point of having this
> syntax!

Never mind 'print', is the update,select,update; sequence legal ? Received on Tue Oct 04 2005 - 16:31:40 CEST

Original text of this message