title: Calling SP with sys_refcursor as out parameter inside another procedure
body: <p>I have an SP </p>
  
  <pre><code>create or replace PROCEDURE         ALTERNATE_NAME_LOOKUP
   ( P_NAME IN VARCHAR2,
    P_TYPE IN VARCHAR2, retCursor OUT SYS_REFCURSOR
   )
  </code></pre>
  
  <p>I didn't paste the rest of its body; The above procedure works fine on its own (with the body of course)</p>
  
  <p>Now I want to call it from another stored procedure, and I want to traverse over the refcursor.</p>
  
  <p>What I am doing is declaring <code>an_last_cur SYS_REFCURSOR;</code> and calling ALTERNATE_NAME_LOOKUP procedure as <code>ALTERNATE_NAME_LOOKUP(p_req.LASTNAMEEXP,c_LAST, an_last_cur);</code> It compiles.
  but when I add following block -</p>
  
  <pre><code> ALTERNATE_NAME_LOOKUP('Roman Reigns','LAST',an_last_cur);
        For alt in an_last_cur
        Loop
          DBMS_OUTPUT.PUT_LINE('ok');
        end loop;
  </code></pre>
  
  <p>It gives compilation error -</p>
  
  <pre><code> PLS-00221: 'AN_LAST_CUR' is not a procedure or is undefined
  </code></pre>
  
  <p>What am I doing wrong?</p>