Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: RE: full usefulness of CURRENT OF ???
using pl/sql with update is very slow. much slower than just sql. so only use if you absolutely have to.
i avoid it at all costs.
>
> From: "Jamadagni, Rajendra" <Rajendra.Jamadagni_at_espn.com>
> Date: 2003/07/11 Fri PM 03:09:24 EDT
> To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
> Subject: RE: full usefulness of CURRENT OF ???
>
> 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-----
> 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
> --
> Author: Maryann Atkinson
> INET: maryann_30_at_yahoo.com
>
> 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).
>
>
> *********************************************************************This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*********************************************************************1
>
>
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-----
From: Maryann Atkinson [mailto:maryann_30@yahoo.com]
Sent: Friday, July 11, 2003 2:54 PM
To: Multiple recipients of list ORACLE-L
Subject: full usefullness of CURRENT OF ???
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
--
Author: Maryann Atkinson
INET: maryann_30@yahoo.com
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@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: <rgaffuri_at_cox.net INET: rgaffuri_at_cox.net 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:23 CDT
![]() |
![]() |