Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

need to commit for every 100 rows

User_G2BGVSep 9 2019 — edited Sep 13 2019

Hi

I have written a stored procedure..But it is taking huge time for 1928 records. I need a commit stmt for every 100 rows.

and please let me know if any mistakes in my coding . .

CREATE OR REPLACE PROCEDURE SP_UPDATECONNECTIONREQ

    AS

       

    CURSOR PI_cur

    IS

        SELECT D.SERIALNUMBER serial_number,DT.PRODUCT_CLASS product_class,DT.OUI oui

        FROM DEVICE D, PROVISIONINGINFO P,DEVICETYPE DT

        WHERE D.PROVISIONINGINFO_ID=P.ID

        and D.DEVICETYPE_ID = DT.ID

        AND P.CONNECTIONREQUESTPASSWORD is null

        AND d.deleted=0;

       

    BEGIN   

    FOR rec IN PI_cur 

    LOOP 

      UPDATE PROVISIONINGINFO SET CONNECTIONREQUESTUSERNAME = CONCAT(CONCAT(CONCAT(rec.oui,'-'),CONCAT(rec.product_class,'-')),rec.serial_number),CONNECTIONREQUESTPASSWORD = CONCAT(CONCAT(CONCAT(rec.oui,'-'),CONCAT(rec.product_class,'-')),rec.serial_number);

      DBMS_OUTPUT.PUT_LINE('Updated::'|| CONCAT(CONCAT(CONCAT(rec.oui,'-'),CONCAT(rec.product_class,'-')),rec.serial_number));

    END LOOP; 

  COMMIT;

    END;

regards

-K

Comments
Post Details
Added on Sep 9 2019
17 comments
1,674 views