title: Oracle Package or function in invalid state
body: <p>Trying to create a pl/sql cursor based function to return details from an oracle database.</p>
  
  <p>The relevant table, <code>MEETING</code>, has the columns
  <code>MEETING_ID</code>: number(10), <code>TIME</code>: timestamp(4), <code>TITLE</code>: varchar(20)</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION GetMeeting
                      (meetingnumber MEETING.MEETING_ID%TYPE)
  RETURN VARCHAR
  IS
      CURSOR current_meeting(meetingnumber MEETING.MEETING_ID%TYPE)
      IS
          SELECT TITLE, TIME
          FROM MEETING
          WHERE MEETING_ID = meetingnumber;
  
      r_meeting current_meeting%ROWTYPE;
  BEGIN
      OPEN current_meeting(meetingnumber);
  
      FETCH current_meeting INTO r_meeting;
  
      IF current_meeting%NOTFOUND THEN
          r_meeting.TITLE := 'UNKNOWN APPOINTMENT';
          END IF;
  
          CLOSE current_meeting;
  
          RETURN r_meeting.TITLE;
      END;
  
  
  SELECT GetMeeting (27) name
  FROM MEETING;
  </code></pre>
  
  <p>The function seems to compile okay - but when called throws </p>
  
  <blockquote>
    <p>ORA-06575: Package or function GETMEETING is in an invalid state</p>
  </blockquote>