title: Oracle Functions - VARCHAR2 length error (PLS-00215)
body: <p>I've been messing around with this for about the last 2 hours, and can't seem to find anything helpful (I've read up on some solutions, but for me they aren't working). I have the following create function statement:</p>
  
  <pre><code>CREATE FUNCTION GetBatchApprovalEmail(net_id IN NUMBER)
    RETURN VARCHAR2
  IS
    email_address VARCHAR2(255);
  
    CURSOR C1 IS
      SELECT T1.approve_email
        FROM LMS.LMS_STATUS_EMAIL T1
          WHERE T1.NET_ID = net_id
  BEGIN
  
    OPEN C1;
    FETCH C1 into email_address;
    CLOSE C1;
  
    RETURN email_address;
  END;
  /
  </code></pre>
  
  <p>For some reason, upon executing this statement I get a </p>
  
  <p><code>PLS-00215 error (String length constraints must be in range(1 .. 32767))</code>. </p>
  
  <p>I've been reading up and most have said to just declare a size for the <code>VARCHAR2</code>, but I've tried and it doesn't make a difference.</p>
  
  <p>Does anyone have any ideas? PS I'm fairly new to <code>PL/SQL</code> so its possible other things aren't correct.</p>