title: Oracle cursor's return type
body: <p>I want to declare the following cursor:</p>
  
  <pre><code>CURSOR some_cursor RETURN oks_trips.trip_id % TYPE IS
      SELECT trip_id FROM oks_trips;
  </code></pre>
  
  <p>But i get an error: </p>
  
  <pre><code>Error(5,36): PLS-00320: the declaration of the type of this expression is incomplete or malformed
  </code></pre>
  
  <p>oks_trips.trip_id type is <code>NUMBER(3, 0)</code>, so i tried just NUMBER instead of <code>oks_tripd.trip_id % TYPE</code> but i still get the error.</p>
  
  <p>I can't omit the <code>RETURN</code> statement because i declare cursor in package and oracle demands it there.</p>
  
  <p>So the question is <em>WHY</em> can't i use <code>NUMBER</code> or <code>some_field % TYPE</code> in cursor's <code>RETURN</code> clause?</p>