Database Tuning (MOSC)

MOSC Banner

Improve FETCH - BULK COLLECT INTO

edited Aug 18, 2020 5:05AM in Database Tuning (MOSC) 3 commentsAnswered

Hi guys I do have this FETCH - BULK COLLECT INTO that i want to improve with 5 millions records in ta

DECLARE

CURSOR cc IS

    SELECT DISTINCT tt.id, t.cat_code, t.type_code

      FROM task t, task_type tt

     WHERE t.cat_code = tt.cat_code

     AND t.type_code = tt.type_code;

TYPE tbl_join IS TABLE OF cc%ROWTYPE;

l_table   tbl_join;

BEGIN

OPEN cc;

LOOP

FETCH cc BULK COLLECT INTO l_table LIMIT 10000;

EXIT WHEN l_table.count = 0;

FORALL i IN l_table.FIRST .. l_table.LAST

    UPDATE task

       SET  task_type_id = l_table (i).id, updated_by = '92'

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center