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