Friday, July 29, 2022

update by cursor in oracle

 DECLARE 

   CURSOR CUR

   IS   

SELECT CREATORS_REFERENCE ORDER_NO, MIN(INVOICE_ID) INVOICE_ID

    FROM IFSAPP.CUST_ORDER_INV_HEAD_UIV_ALL@PROD I

    WHERE  I.CREATORS_REFERENCE IN (SELECT ORDER_NO FROM DIFF_HAPS_IFS_TAB WHERE CREATORS_REFERENCE=ORDER_NO)

    GROUP BY CREATORS_REFERENCE;

BEGIN


   FOR REC IN CUR

   LOOP

      UPDATE DIFF_HAPS_IFS_TAB SET INVOICE_ID=REC.INVOICE_ID

      WHERE ORDER_NO=REC.ORDER_NO;

   END LOOP;

   COMMIT;

END;

/


No comments:

Post a Comment

How to install and configure Oracle Apex 24.1 with ORDS 22, Tomcat 9 and Jasper Report 7 on Oracle Linux 8.10

#########################Install Oracle  APEX 24.1################################ ----------------------------------------------------...