title: How to loop a SYS_REFCURSOR with multiple tables?
body: <p>sorry for the kind of broad title to the question, but I didn't find a way to simplify it further.</p>
  
  <p>I'm creating a package for a client, this package has a procedure which returns a <code>SYS_REFCURSOR</code>. The query that feeds it is a multi-table select with about 20 fields. On a second procedure I need to call this one, and loop through the results to feed other locations. </p>
  
  <p>I'm having problems using the <code>into</code> part of the loop. I can't use <code>table%ROWTYPE</code>. I tried to declare an <code>OBJECT</code> on the procedure but it was not allowed. Will I have to do a <code>FETCH XXX INTO LIST_OF_INDVIDUAL_VARIABLES</code>?</p>
  
  <pre><code>DECLARE
      dt_field TABLE1.dt_field%TYPE;
      p_resultset SYS_REFCURSOR;
      p_individual OBJECT ( 
       FIELD0         DATE,
       FIELD1         TABLE.FIELD1%TYPE,
       FIELD2         TABLE.FIELD2%TYPE,
       FIELD3         TABLE.FIELD3%TYPE,
       FIELD4         TABLE.FIELD4%TYPE
   );
  
   BEGIN
      PACKAGE.PROCEDURE1(dt_field);
      dbms_output.put_line(dt_field);
      PACKAGE.PROCEDURE2(dt_field, p_resultset);
  
     LOOP 
       -- this do not work
       FETCH p_resultset INTO p_individual;
       EXIT WHEN p_resultset%NOTFOUND;
       -- DO STUFF ON EACH RETURNED ROW
     END LOOP;
     CLOSE p_resultset;      
   END;
  </code></pre>