Re: Bulk Collect pivot problem, missing rows!!

From: Jusung Yang <JusungYang_at_yahoo.com>
Date: 15 Jul 2003 01:30:52 -0700
Message-ID: <130ba93a.0307150030.fbfa4e5_at_posting.google.com>


[Quoted] open c1;

    loop

        fetch c1 bulk collect into pernr_tab, begda1_tab, begda2_tab, pernr_begda_tab LIMIT rows;

        forall j in pernr_tab.FIRST .. pernr_tab.LAST

            insert into merge_main_tab

(PERNR, BEGDA, PERNR_BEGDA)
values
(pernr_tab(j), begda1_tab(j), pernr_begda_tab(j));
insert into merge_main_tab
(PERNR, BEGDA, PERNR_BEGDA)
values
(pernr_tab(j), begda2_tab(j), pernr_begda_tab(j));
exit when c1%NOTFOUND; end loop; close c1; ----------------------------

If this is your real code, forall is meant for a single SQL statement only. Why do you have 2 same inserts into the same table? Also, if you are using 9.2, you can use table of record type instead. So the statement will be like:

forall j in pernr_tab.FIRST .. pernr_tab.LAST

   insert into merge_main_tab values tab_of_record(j);

  • Jusung Yang
Received on Tue Jul 15 2003 - 10:30:52 CEST

Original text of this message