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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL help needed

Re: PL/SQL help needed

From: Gygy Berlogea <EMailAddressNotAvailable_at_PleasePostOnTheNewsGroup.com>
Date: Fri, 06 Aug 1999 17:25:11 GMT
Message-ID: <XTEq3.1625$nD1.6434@tundra.ops.attcanada.net>


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>...

    James Garrison wrote:

    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

    WHERE p.policy_number = rc.policy_number     AND p.renewal_code = 1
    AND rc.status_1 = 5;

    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;

    END;     Ken Received on Fri Aug 06 1999 - 12:25:11 CDT

Original text of this message

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