I have a 5 Million row table that I'm trying to recreate as a partitioned table. Basically I've created a matching, partitioned table and am using a cursor loop to read a row from the original table and inserting it into the new table. It is doing a commit after each insert which is slowing things down. Is there any way inside of a simple cursor loop to tell to only commit every X number of rows?
Here is the loop
CURSOR c_Customer_Dim IS
SELECT * FROM MKDM.CUSTOMER_DIM;
FETCH c_Customer_Dim into v_Customer_Data;
WHILE c_Customer_Dim%FOUND LOOP
INSERT INTO MKDM.PART_CUSTOMER_DIM (
FETCH c_Customer_Dim INTO v_Customer_Data;
[Edited by wjramsey on 03-27-2001 at 07:37 AM]
Senior Database Administrator
Of course. Just set up a counter and commit every x rows.
x := 0
IF ( mod(x, 100) = 0) THEN
Why not use , alter table ...exchange partition option.
Actually, it will slow things down a little bit by using mod, you can just use counter to determine the commit point, somthing like:
If counter = X THEN ----- X rows to commit
counter := 0;
counter := counter + 1;
Click Here to Expand Forum to Full Width