title: Why am i getting this: PLSQL String length constraint Error
body: <p>i have being working on this code for a while now and have tried everything i can think of.</p>
  <p>This is the code block:</p>
  <pre><code>CREATE OR REPLACE PROCEDURE ADD_LOCATION_TO_DB (ploccode VARCHAR2, pminqty 
  NUMBER, pmaxqty NUMBER)AS
      Err_Locode_Length EXCEPTION;
      Err_Minqty_Range EXCEPTION;
      Err_Maxqty_Range EXCEPTION;
      Err_Maxqty_Greater_Minqty EXCEPTION;
  BEGIN
      IF LENGTH(ploccode) != 5 THEN
          RAISE Err_Locode_Length;
      ELSE IF pminqty &gt; 10 OR pminqty &lt; 0 THEN
          RAISE Err_Minqty_Range;
      ELSE IF pmaxqty &gt; 10 OR pmaxqty &lt; 0 THEN
          RAISE Err_Maxqty_Range;
      ELSE IF pminqty &gt; pmaxqty THEN
          RAISE Err_Maxqty_Greater_Minqty;
      END IF;
      END IF;
      END IF;
      END IF;
  INSERT INTO LOCATION
  VALUES (ploccode, pminqty, pmaxqty);
  EXCEPTION
      WHEN DUP_VAL_ON_INDEX THEN
          RAISE_APPLICATION_ERROR(-20081,'Duplicate Location ID');
      WHEN Err_Locode_Length THEN
          RAISE_APPLICATION_ERROR(-20082,'Location Code Lenght invalid');
      WHEN Err_Minqty_Range THEN
          RAISE_APPLICATION_ERROR(-20083,'Minium Qty is out of range');
      WHEN Err_Maxqty_Range THEN
          RAISE_APPLICATION_ERROR(-20084,'Maximum Qty is out of range');
      WHEN Err_Maxqty_Greater_Minqty THEN
          RAISE_APPLICATION_ERROR(-20086,'Minium Qty is Lager than Maximum Qty');
      WHEN OTHERS THEN
          RAISE_APPLICATION_ERROR(-20000,'Use Value of SQLERRM');
  END;
  /
  CREATE OR REPLACE PROCEDURE ADD_LOCATION_VIASQLDEV AS
      Dis_Msg VARCHAR2;
      ploccode VARCHAR2;
      pminqty NUMBER;
      pmaxqty NUMBER;
  BEGIN
      dbms_output.put_line('--------------------------------------------------');
      dbms_output.put_line('Adding location  LocCode: ' || ploccode || ' MinQty: ' || pminqty || 'MaxQty' || pmaxqty);
      ADD_LOCATION_TO_DB(ploccode, pminqty, pmaxqty);
      dbms_output.put_line(Dis_Msg);
  END;
  /
  </code></pre>
  <p>When i run this set of procedures i get an error in the compiler stating:</p>
  <blockquote>
  <p>Error(1,13): PLS-00215: String length constraints must be in range (1 .. 32767)</p>
  <p>Error(2,14): PLS-00215: String length constraints must be in range (1 .. 32767)</p>
  </blockquote>
  <p>I have tried adding constraints to the code that calls the main Procedure:</p>
  <pre><code>CREATE OR REPLACE PROCEDURE ADD_LOCATION_VIASQLDEV AS
      Dis_Msg VARCHAR2(40);
      ploccode VARCHAR2(5);
      pminqty NUMBER(2);
      pmaxqty NUMBER(2);
  BEGIN
      dbms_output.put_line('--------------------------------------------------');
      dbms_output.put_line('Adding location  LocCode: ' || ploccode || ' MinQty: ' || pminqty || 'MaxQty' || pmaxqty);
      ADD_LOCATION_TO_DB(ploccode, pminqty, pmaxqty);
      dbms_output.put_line(Dis_Msg);
  END;
  /
  </code></pre>
  <p>Adding these constrains does remove the errors with the compiler however i still revive errors when executing this testing code:</p>
  <pre><code>Error starting at line : 48 in command -
  begin
  dbms_output.put_line('Student ID: 1234567');
  dbms_output.put_line('==========PART 3 TEST LOCATIONS==========================');
  ADD_LOCATION_VIASQLDEV ('AF201',1,2);
  ADD_LOCATION_VIASQLDEV('AF202',-3,4);
  ADD_LOCATION_VIASQLDEV ('AF203',5,1);
  ADD_LOCATION_VIASQLDEV ('AF204',6,7000);
  ADD_LOCATION_VIASQLDEV ('AF20111',8,9);
  end;
  Error report -
  ORA-06550: line 4, column 1:
  PLS-00306: wrong number or types of arguments in call to 'ADD_LOCATION_VIASQLDEV'
  ORA-06550: line 4, column 1:
  PL/SQL: Statement ignored
  ORA-06550: line 5, column 1:
  PLS-00306: wrong number or types of arguments in call to 'ADD_LOCATION_VIASQLDEV'
  ORA-06550: line 5, column 1:
  PL/SQL: Statement ignored
  ORA-06550: line 6, column 1:
  PLS-00306: wrong number or types of arguments in call to 'ADD_LOCATION_VIASQLDEV'
  ORA-06550: line 6, column 1:
  PL/SQL: Statement ignored
  ORA-06550: line 7, column 1:
  PLS-00306: wrong number or types of arguments in call to 'ADD_LOCATION_VIASQLDEV'
  ORA-06550: line 7, column 1:
  PL/SQL: Statement ignored
  ORA-06550: line 8, column 1:
  PLS-00306: wrong number or types of arguments in call to 'ADD_LOCATION_VIASQLDEV'
  ORA-06550: line 8, column 1:
  PL/SQL: Statement ignored
  06550. 00000 -  &quot;line %s, column %s:\n%s&quot;
  *Cause:    Usually a PL/SQL compilation error.
  *Action:
  </code></pre>
  <p>Can some one please tell me what i'm doing wrong.</p>
  <p>Apologies if this is to much information or my formating is wrong.</p>