title: Can I pass an explicit cursor to a function/procedure for use in FOR loop?
body: <p>I have a procedure that performs some calculations on all records returned by a cursor. It looks a bit like this:</p>
  
  <pre><code>PROCEDURE do_calc(id table.id_column%TYPE)
  IS
    CURSOR c IS
      SELECT col1, col2, col3
        FROM table
       WHERE ...;
  BEGIN
    FOR r IN c LOOP
      -- do some complicated calculations using r.col1, r.col2, r.col3 etc.
    END LOOP;
  END;
  </code></pre>
  
  <p>Now I have the case where I need to perform the exact same calculation on a different set of records that come from a different table. However, these have the same "shape" as in the above in example.</p>
  
  <p>Is it possible to write a procedure that looks like this:</p>
  
  <pre><code>PROCEDURE do_calc2(c some_cursor_type)
  IS
  BEGIN
    FOR r IN c LOOP
      -- do the calc, knowing we have r.col1, r.col2, r.col3, etc.
    END LOOP;
  END;
  </code></pre>
  
  <p>I know about <code>SYS_REFCURSOR</code>, but I was wondering if it was possible to use the much more convenient <code>FOR ... LOOP</code> syntax and implicit record type.</p>