title: Oracle stored procedure - Loop within cursor
body: <p>I have a stored proc Procedure1,</p>
  
  <ol>
  <li>Within Procedure1, I am calling another procedure Procedure2 which returns sys_refcursor ProcResult2.</li>
  <li>I need to traverse through each row of this cursor and insert the data into a table</li>
  </ol>
  
  <p>The code</p>
  
  <pre><code>Create Procedure1()  
  as   
  ProcResult1 Sys_refcursor;  
  begin  
      Procedure2(ProcResult2);  
      For eachrow in ProcResult2  
        Loop  
          insert into test_table(ProcResult2.Id);  
        end loop;  
  end ;\  
  </code></pre>
  
  <p>Any idea, pointers on how to achieve the 2. functionality ? That is traverse through each row returned in ProcResult2 and insert into a new table.</p>