title: Replace iteration's fetch to BULK COLLECT
body: <p>There is an object type and table consists of that objects. 
  So here we go:</p>
  
  <pre><code>create or replace type lpu.someobj_o as object
  (      
    name VARCHAR2(75),     
    enroll_date DATE,
    id NUMBER(12)
  )
  
  CREATE OR REPLACE TYPE lpu."SOMEOBJ_T" IS TABLE OF someobj_o;
  </code></pre>
  
  <p>There's also PL/SQL function that works in common <a href="http://en.wikipedia.org/wiki/Extract,_transform,_load" rel="nofollow">ETL principle</a>. Here is piece of code function:</p>
  
  <pre><code>  for some_cursor_rec in some_cursor(startTime, recordInterval) loop
    open some_cur2(some_cursor_rec.name, some_cursor_rec.id);
    fetch some_cur2 into some_cursor_rec2;
    if some_cur2%rowcount &gt; 0 then
      loop
        pipe row (
          lpu.someobj_o(
          id =&gt; some_cursor_rec2.id, 
          name =&gt; some_cursor_rec2.name, 
          enroll_date =&gt; some_cursor_rec2.enroll_date
        )
        );
        fetch some_cur2 into some_cursor_rec2;
        exit when some_cur2%notfound;
      end loop;      
    end if;
    close some_cur2;
  end loop;
  </code></pre>
  
  <p>Ok, so the issue is small performance. How can I increase speed of completing of this function? I have read that <code>BULK COLLECT</code> should improve performance. But how can I use it in my case? I have tried <code>BULK COLLECT</code> but it gave me error that type of collection is wrong. 
  Thanks in advance! Really hope for your help!</p>