title: Casting a ref cursor into a table type in pl-sql
body: <p>I would like to cast a refcursor into a table type as shown below. The syntax below does not compile.The purpose is to get the results of a refcursor into a temporary table and then do some work on that table.</p>
  
  <pre><code>    create table vtest1 (a number, b number); 
      create table temptable1(a number, b number); 
      declare 
      pOUT SYS_REFCURSOR;
      type vtest1Tab is table of vtest1%rowtype;
      begin
        open pOUT for 'select * from vtest1';
        insert into temptable1(n1,n2)  
        select * from TABLE( cast(pOUT as vtest1Tab));
        close pOUT;
      end;    
  </code></pre>
  
  <p>Thanks.</p>