So there's no BULK COLLECT APPEND
or anything, but you can combine multiple nested tables with MULTISET UNION
. So you could populate multiple nested tables and then combine them. I'm not sure what the performance would be compared to a single UNION
SQL query, but I expect it would be much better than anything working in a loop.
So you'd do something like this:
SELECT customer_id BULK COLLECT
INTO customer_id_table_1
FROM old_customers cust
WHERE cust.last_update_date BETWEEN SYSDATE - 100 AND SYSDATE;
SELECT customer_id BULK COLLECT
INTO customer_id_table_2
FROM new_customers cust
WHERE cust.last_update_date BETWEEN SYSDATE - 100 AND SYSDATE;
customer_id_table_1 := customer_id_table_1 MULTISET UNION customer_id_table_2;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…