I am trying to solve this piece of code with a bulk insert or something else more effective but I am out of ideas. How would you approach this problem. Instead of looping so many times i would like to do it more effective in few calls. Please let me know how you would do? With code if possible! Thanx
LOOP
-- Fetch a row
IF DBMS_SQL.FETCH_ROWS(cursor_handle) > 0 THEN
DBMS_SQL.column_value(cursor_handle, 9, cont_id);
DBMS_SQL.COLUMN_VALUE(cursor_handle, 3, proj_nr);
HTP.BOLD('ContractID: ' || cont_id || ' ProjectNR: ' || proj_nr);
HTP.BR;
ELSE
EXIT;
END IF;
-- delete the old list before saving a new one
IF sek_nr = 1 THEN
EXECUTE IMMEDIATE 'DELETE FROM W_Contracts WHERE user_id = :n' USING CURRENTUSER;
END IF;
EXECUTE IMMEDIATE 'Insert into W_Contracts values(''' || currentUser || ''', '
|| sek_nr || ', sysdate, ' || cont_id || ', '''
|| proj_nr || ''')';
sek_nr := sek_nr + 1;
END LOOP;