title: BULK COLLECT INTO inside OPEN cursor FOR SELECT... doesn't populate collection
body: <p>I have a procedure, which returns cursor as an output parameter. Inside SP the output cursor variable is opened as SELECT statement. I was to reuse records from this cursor for the following logic in the SP, and used BULK COLLECT clause to store them in a nested table. But found out, that without any exception this nested table is not populated.
  I wrote a simple example to illustrate this behavior:</p>
  
  <pre><code>create table temp_table as
  select 1 as col1 from dual
  union all
  select 2 as col1 from dual;
  
  declare
    v_cur sys_refcursor;
    v_rec temp_table%rowtype;
    procedure get_cursor(v_cur OUT sys_refcursor) is
      type typ_temp_tab_tab is table of temp_table%rowtype;
      v_tab typ_temp_tab_tab;
    begin
      v_tab:=typ_temp_tab_tab();
      open v_cur for 
        select * 
        bulk collect into v_tab
          from temp_table;
      dbms_output.put_line('nested table''s records num: '||v_tab.count);
    end;
  begin
    get_cursor(v_cur);
    dbms_output.put_line('values in cursor: ');
    loop
      fetch v_cur into v_rec;
      exit when v_cur%NOTFOUND;
      dbms_output.put_line('&gt;&gt;'||v_rec.col1);   
    end loop;
  end;
  /
  drop table temp_table;
  </code></pre>
  
  <p>And output is:</p>
  
  <blockquote>
  <pre><code>nested table's records num: 0
  values in cursor: 
  &gt;&gt;1
  &gt;&gt;2
  </code></pre>
  </blockquote>
  
  <p>Do you have any idea why it's not working and what is the best practice to reuse cursor's records inside a SP?</p>