Could anyone give us an idea as to the full usefullness
of CURRENT OF? Here are my two separate examples:
/* 1 this one has a CURRENT OF */
DECLARE
CURSOR EmpCursor IS
SELECT *
FROMEmp
FOR UPDATE;
BEGIN
FOR EmpRec IN EmpCursor LOOP
from the cursor and updating the table
based on those values.
-Original Message-
Sent: Friday, July 11, 2003 1:54 PM
To: Multiple recipients of list ORACLE-L
Could anyone give us an idea as to the full usefullness
of CURRENT OF? Here are my two separate examples:
/* 1 this one
much need to use
WHERE CURRENT OF.
HTH
Kevin
-Original Message-
Sent: Friday, July 11, 2003 2:54 PM
To: Multiple recipients of list ORACLE-L
Could anyone give us an idea as to the full usefullness
of CURRENT OF? Here are my two separate examples:
/* 1 this one has a CURRENT
--- Chris Stephens [EMAIL PROTECTED] wrote:
Also, the CURRENT OF locks the table so that no one can modify (or
even read) it while the transaction is taking place. This guarantees
nothing is changing between retrieving values from the cursor and
updating the table based on those values.
--- Kevin Toepke [EMAIL PROTECTED] wrote:
Yes, using WHERE CURRENT OF is faster. It is the same as saying
WHERE rowid = emprec.rowid, just more readable. And accesses by
rowid are faster than index accesses.
Also, what happens if you don't have a unique or primary constraint
on the table
Repeat after me...readers never block writers...writers never block readers...
The update will lock the row(s) of the result set, but it will not block anyone from
reading the data. However, they may not read the modifications made by the update
until it is committed.
MaryAnn Atkinson wrote:
Also, the CURRENT OF locks the table so that no one can modify (or
even read) it while the transaction is taking place. This guarantees
nothing is changing between retrieving values from the cursor and
updating the table based on those values.
Actually, it is the FOR UPDATE that locks the
recipients of list ORACLE-L [EMAIL PROTECTED]
Subject: RE: full usefullness of CURRENT OF ???
--- Chris Stephens [EMAIL PROTECTED] wrote:
Also, the CURRENT OF locks the table so that no one can modify (or
even read) it while the transaction is taking place. This guarantees
nothing
Title: RE: full usefullness of CURRENT OF ???
Locking if something oracle is very good at. It happens all over the place and it happens quickly...there is very little overhead to it.
Block headers. ...each block in the affected table.
By updating the table by rowid, you get
Could anyone give us an idea as to the full usefullness
of CURRENT OF? Here are my two separate examples:
/* 1 this one has a CURRENT OF */
DECLARE
CURSOR EmpCursor IS
SELECT *
FROMEmp
FOR UPDATE;
BEGIN
FOR EmpRec IN EmpCursor LOOP
Hi!
Actually, it is the FOR UPDATE that locks the table.
No, for update still locks *only the rows* selected with for update clause.
All other parts of table are available for both reading AND writing (of
course if other transactions don't have locks on some rows).
And you can read the
to put inside the cursor?
From: MaryAnn Atkinson [EMAIL PROTECTED]
Date: 2003/07/11 Fri PM 04:09:25 EDT
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Subject: RE: full usefullness of CURRENT OF ???
--- Chris Stephens [EMAIL PROTECTED] wrote:
Also, the CURRENT
12 matches
Mail list logo