Connecting Tech Pros Worldwide Forums | Help | Site Map

forall operator

Member
 
Join Date: Nov 2007
Posts: 75
#1: Nov 14 '07
How can we use Forall operation for following progm ...
If we use for it takes times ..I wanted to use bulk bind for faster execution ,,
Can u plz suggest how and where to use forall operator in this following progm

Expand|Select|Wrap|Line Numbers
  1. declare
  2.     vl_c_event_ct   varchar2(1000);
  3.     vl_c_eventcd    varchar2(1000);
  4.     vl_c_class      Varchar2(1000);
  5.     Cursor c1 is select ACC_NUMBER, START_DATE ,END_DATE from am_test;
  6.  begin
  7.     for r1 in c1
  8.    loop
  9.        select sum( scs),evn_ID,TR_26
  10.         into vl_c_event_ct,vl_c_eventcd,vl_c_class from costt_test
  11.          where ACCOUNT_NUM in (select substr(acc_number,4,10) from am_test) and
  12.        to_char(CREATED_DTM,'ddmmyyyy') between (to_char(r1.START_DATE,'ddmmyyyy')) and(to_char(r1.END_DATE,'ddmmyyyy'))
  13.        group by EVENT_TYPE_ID,EVENT_ATTR_26 ;
  14.        dbms_output.put_line(vl_c_event_ct||' '||vl_c_eventcd||' '||vl_c_class);
  15.       insert into am_test2 values(vl_c_event_ct ,vl_c_eventcd ,vl_c_class  ,r1.ACC_NUMBER ,r1.START_DATE ,r1.END_DATE );
  16.   end loop ;
  17.  end;
  18.  

amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#2: Nov 14 '07

re: forall operator


Orajit,

Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

MODERATOR
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#3: Nov 14 '07

re: forall operator


Check here and here about BULK BIND and FORALL
Reply