title: Why am I getting "PLS-00405: subquery not allowed in this context" error?
body: <p>I am a newbie when it comes to PL/SQL. I have the following block of PL/SQL code:</p>
  
  <pre><code>FUNCTION  evaluate(p_sid IN NUMBER, p_min_len IN NUMBER, p_max_len IN NUMBER) RETURN VARCHAR2
  IS
      v_res VARCHAR2(255);
  BEGIN
      v_res := evaluate_batch(CURSOR(SELECT sid, stext FROM maintable WHERE sid = p_sid), p_min_len, p_max_len);
  
      RETURN v_res;
  
  END eval_ocr_quality;
  </code></pre>
  
  <p>where</p>
  
  <pre><code>TYPE text_rec_t IS RECORD (
          rec_id NUMBER,
          text CLOB);
  TYPE text_rec_cur_t IS REF CURSOR RETURN text_rec_t;
  
  FUNCTION  evaluate(p_sid IN NUMBER, p_min_len IN NUMBER := 3, p_max_len IN NUMBER := 3) RETURN VARCHAR2;
  
  FUNCTION  evaluate_batch(p_cur IN text_rec_cur_t, p_min_len IN NUMBER := 3, p_max_len IN NUMBER := 3) RETURN VARCHAR2;
  </code></pre>
  
  <p>I get <code>PLS-00405: subquery not allowed in this context</code> error at the <code>v_res := evaluate_batch</code> line</p>
  
  <p>What am I doing wrong?</p>