Re: "Transactions are bad, real bad" - discuss

From: Mikito Harakiri <mikharakiri_at_ywho.com>
Date: Wed, 30 Apr 2003 11:52:08 -0700
Message-ID: <C1Vra.7$i92.25_at_news.oracle.com>


"Alfredo Novoa" <alfredo_at_ncs.es> wrote in message news:e4330f45.0304300214.799edb54_at_posting.google.com...
> "Mikito Harakiri" <mikharakiri_at_ywho.com> wrote in message
news:<KLCra.5$735.322_at_news.oracle.com>...
>
> > How about
> >
> > UPDATE (
> > select a1.AccountOwner ao1, a1.Balance b1, a2.AccountOwner ao2,
> > a2.Balance b2
> > from Accounts as a1, Accounts as a2
> > ) set b1 = b1 - 1000000, b2 = b2 + 1000000
> > where ao1 = 'Paul Vernon' and ao2 = 'Jonathan Leffler'
>
> Nice, but it does not work with all SQL DBMSs
>
> What about?
>
> update Accounts set Balance := Balance - 1000000
> where AccountOwner = 'Paul Vernon',
> update Accounts set Balance := Balance + 1000000
> where AccountOwner = 'Jonathan Leffler';
>
>
> It is a lot easier to understand.

Certainly easier to understand, but Paul suggested that any set of updates can be equivalently expressed as a single update. This was especially relevant in the old discussion about view updates:

http://www.google.com/groups?q=transaction+view+update+group:comp.databases. theory+author:paul+author:vernon&hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&selm=ann 8d5%24129s%242%40sp15at20.hursley.ibm.com&rnum=1

His last example involved relation aliases and a union view. Here I'm suggesting Cartesian Product. My example, however, is "thought in process": I'm not even sure that cartesian self-product view is legitemately updateable. Received on Wed Apr 30 2003 - 20:52:08 CEST

Original text of this message