DECLARE CURSOR CUR_TEMP IS SELECT * FROM ODS_AP_INVOICES_ALL@hw_dwuat.huawei.com; TYPE TBL_TEMP IS TABLE OF CUR_TEMP%ROWTYPE; L_TBL_TEMP TBL_TEMP := TBL_TEMP(); BEGIN /*FOR REC IN CUR LOOP OPEN CUR FOR 'SELECT * FROM '||TAB_NAME END LOOP;*/ EXECUTE IMMEDIATE 'TRUNCATE TABLE ODSAP.ODS_AP_INVOICES_ALL'; OPEN CUR_TEMP; LOOP FETCH CUR_TEMP BULK COLLECT INTO L_TBL_TEMP LIMIT 1000; FORALL I IN 1 .. L_TBL_TEMP.COUNT INSERT INTO ODS_AP_INVOICES_ALL VALUES L_TBL_TEMP(I); COMMIT; EXIT WHEN CUR_TEMP%NOTFOUND; END LOOP; CLOSE CUR_TEMP; COMMIT; L_TBL_TEMP.DELETE; END;