5 Replies Latest reply on Apr 18, 2013 2:35 PM by Andreas Weiden

    Looping through records that havent been added yet

      Hi guys,

      I was wondering if you could help me out. I need to loop through some records to count a specific flag. I have doen this before on a block which has been queried back from the database using the code below. However, under this scenario it has not been added to the database. The records have not been inserted yet, hence im not sure how to get the blk_cnt variable I have used in the example below. Could anyone help me out? perhaps I need a whole different approach?


      n_tot_rec NUMBER := 0;
      n_blk_cnt NUMBER := Get_Block_Property('BLK,QUERY_HITS);
      n_added_count number := 0;


      WHILE n_tot_rec < n_blk_cnt LOOP
      if name_in('blk.added') = 'Y' then
      n_added_count = n_added_count + 1;
      end if;

      if name_in('SYSTEM.LAST_RECORD') = 'FALSE' then
      end if;

      n_tot_rec := n_tot_rec +1;

      END LOOP;