Re: locking in 5.1 SE.
Posted in 1995
In article <4bgnl8$ic7@cssun.mathcs.emory.edu>, suresh@psi.ernet.in says... > >The process I have adopted for locking is : >DECLARE CURSOR FOR UPDATE; >OPEN CURSOR; >FETCH CURSOR; > >But, while I Fetch the next row, Lock on the existing row is removed. >Is there any other way to lock the rows in such a way that lock is retained >until COMMIT or ROLLBACK? > This is happening because you don't perform an update on the fetched row. So when you fetch the next one, the lock on the previous one gets released. My work arround on this situations is to execute a false update, i.e., change the value of a column, of the fetched row, to the same value (not pretty i know). Since an updated was done the row remains locked until commit/rollback. Not much, but hope tihs helps. -- -------------------------------------------------------------------------------------- Joao Natal E-mail: natal@telepac.pt Porto, Portugal Et in Arcadia ego... --------------------------------------------------------------------------------------