Re: Bulk Collect pivot problem, missing rows!!

From: rohit <rohitk1973_at_yahoo.com>
Date: 15 Jul 2003 08:24:36 -0700
Message-ID: <74353ecc.0307150724.677c53c7_at_posting.google.com>


Thanks Jusung!! I came to the same conclusion myself, put the two inserts under two separate FORALLs and code is good now, runs under 20 minutes. I have to use single dimension PL/SQL tables as Oracle version is 8.1.7.4.

Rohit

JusungYang_at_yahoo.com (Jusung Yang) wrote in message news:<130ba93a.0307150030.fbfa4e5_at_posting.google.com>...
> 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 - 17:24:36 CEST

Original text of this message