Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL help needed
But wait,
Here we have a summary of the PREVIOUS solutions.
And, please note the naming convention used for the cursor variable "i" =
( previously "policy_number" )
this, in it's own length, would consume most Oracle resources,
and there's always a chance that someone might be able to read this code =
(!!!).
The Observer.
Kenneth C Stahl wrote in message =
<379DC9B7.8A652258_at_Unforgettable.com>...
Yee gads, how did you ever come up with this code?
If you want to update specific rows, do it like this:
Declare
CURSOR some_policies IS
SELECT p.policy_number,
p.policy_date_time p.rowid FROM policy p, register_cur rc
BEGIN
FOR I IN some_policies LOOP UPDATE policy SET non_renewal_reason = 'I' WHERE rowid = i.rowid; COMMIT; DBMS_OUTPUT.PUT_LINE (SQL%ROWCOUNT || ' policies.'); DBMS_OUTPUT.PUT_LINE ('Policy number ' || v_policy_no || ' .'); END LOOP;
![]() |
![]() |