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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: full usefulness of CURRENT OF ???

RE: full usefulness of CURRENT OF ???

From: Mercadante, Thomas F <NDATFM_at_labor.state.ny.us>
Date: Fri, 11 Jul 2003 11:19:30 -0800
Message-ID: <F001.005C462B.20030711111930@fatcity.com>


this is better than using rowid in the update clause????  

Tom Mercadante
Oracle Certified Professional

-----Original Message-----
Sent: Friday, July 11, 2003 3:09 PM
To: Multiple recipients of list ORACLE-L

Try with a complicated where clause where your where_clause is a page long ...

Raj




Rajendra dot Jamadagni at nospamespn dot com All Views expressed in this email are strictly personal. QOTD: Any clod can have facts, having an opinion is an art !

-----Original Message-----
<mailto:maryann_30_at_yahoo.com> ]
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 OF */

DECLARE     CURSOR EmpCursor IS

            SELECT  * 
            FROM    Emp 
            FOR     UPDATE; 

BEGIN 
     FOR EmpRec IN EmpCursor LOOP 

         UPDATE EMP 
         SET    SALARY = SALARY * 1.08 
         WHERE  CURRENT OF EmpCursor 

     END LOOP; 

END; /* 2 same as above, except without the CURRENT OF */ DECLARE    CURSOR EmpCursor IS

           SELECT  * 
           FROM    Emp 
           FOR     UPDATE; 

BEGIN 
     FOR EmpRec IN EmpCursor LOOP 

         UPDATE EMP 
         SET    SALARY = SALARY * 1.08 
         WHERE  EMP_ID = EmpRec.Emp_ID; 

     END LOOP; 

END;
/

Is one more efficient than the other? If I could have done business without the CURRENT OF, then why did oracle made it available?

thx
maa

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net <http://www.orafaq.net>
--

Author: Maryann Atkinson
  INET: maryann_30_at_yahoo.com

Fat City Network Services -- 858-538-5051 http://www.fatcity.com <http://www.fatcity.com>
San Diego, California -- Mailing list and web hosting services



To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Mercadante, Thomas F
  INET: NDATFM_at_labor.state.ny.us

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Jul 11 2003 - 14:19:30 CDT

Original text of this message

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