I need to load data from different remote database into our own database. I write a single “complex” query using WITH statement. It is around 18 Million rows of data.
What is most efficient way to do the insert?
- using cursor insert one by one
- using INSERT INTO
or is there any other way?
The fastest way to do anything should be to use a single SQL statement. The next most efficient approach is to use a cursor doing
BULK COLLECToperations to minimize context shifts between the SQL and PL/SQL engines. The least efficient approach is to use a cursor and process the data row-by-row.