Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: oracle - mysql comparison

Re: oracle - mysql comparison

From: Volker Hetzer <volker.hetzer_at_ieee.org>
Date: Tue, 20 Jul 2004 20:38:29 +0200
Message-ID: <cdjor6$ctg$1@nntp.fujitsu-siemens.com>

"VC" <boston103_at_hotmail.com> schrieb im Newsbeitrag news:RfdLc.109372$WX.92600_at_attbi_s51...
> Here's another textbook example for you:
> ==
> There are two linked accounts (id=1 and id=2) in a bank. A transaction
> might look as follows:
>
> == withdraw from 1
> select amount into x from accounts where id=1
> select amount into y from accounts where id=2
> if x+y >= withdrawal then update accounts set amount=amount-withdrawal
> where id=1
> commit
> =====
>
> Any commercial locking scheduler will handle the scenario correctly. Oracle
> won't.

Sorry for butting in but I'm just trying to learn here, so what would go wrong? And what about "select for update" in oracle? It's supposed to lock the rows it hits.

Lots of Greetings!
Volker Received on Tue Jul 20 2004 - 13:38:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US