Re: Informix vs. Oracle
Posted in 1997
tkyte@us.oracle.com (Thomas Kyte) wrote: :Well, perhaps you are committing in Informix because it cannot handle infinitely :many locks? No, it can handle enough locks. I commit to release the locks so others can do their updates as soon as possible. Multi user OLTP with simultaneous large batch processes requires this. : I would not commit in an update transaction until I was *done* in :the update transaction myself. It is trivial to support this (the above) :however in Oracle as such: : : for x in ( select rowid from T where ... ) loop : select * into SomeRec from T where rowid = x.rowid for update; : ..... do whatever .... : : if ( someCondition ) then : commit; : end if; : end loop; : :(note: rowid in Oracle is different from rowid in Informix. The rowid is the :physical address (file/block/slot in block) of a row, it is the fastest way to :get the data as it does one IO and since you are reading the table in the above :example, it doesn't really matter -- the block is already cached). Your solution, although a little roundabout, is ok of course as the second select would read from the cash. (Of course I assume in a real application one would use prepared statements so the engine wouldn't have to interpret and optimise the selects all the time.) Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org