title: Declaring SYS_REFCURSOR and ROWTYPE in stored procedure
body: <p>So I have a stored procedure <code>ONE</code></p>
  
  <pre><code>create or replace PROCEDURE ONE
  (
     A in number
     B in number
     ...
     ZZ out SYS_REFCURSOR
  ) IS
    SOME_OTHER_STUFF
  BEGIN
     ...
  END
  </code></pre>
  
  <p>This returns a sys_refcursor with some data I need. I then have a stored procedure <code>TWO</code></p>
  
  <pre><code>create or replace PROCEDURE TWO
  (
     A in number
     B in number
     ...
     ZZ out SYS_REFCURSOR
  ) IS
       Count_Records Sys_Refcursor;
       l_rec Count_Records%rowtype;
  BEGIN
      /* get some data from the ONE stored procedure to use on this procedure*/
      ONE(A,B,...Count_Records)
  
      Loop
         fetch count_records into l_rec;
         Exit When count_records%Notfound;
         If  l_rec.TT_RAW &gt; MAX_RECORDS  Then
           Raise To_Many_Results;
         End If;
      End Loop;
  
  END
  </code></pre>
  
  <p>I'm getting an error when I try to declare the rowtype <code>l_rec Count_Records%rowtype;</code> </p>
  
  <p>How can I declare this variable? The problem is that <code>TT_RAW</code> which is the column I'm trying to get is a SUM and the cursor is not mapped to any table it includes a lot of calculation.</p>
  
  <p>Thanks</p>