title: Getting PL/SQL: numeric or value error: character to number conversion error
body: <p>I'm getting this error:  </p>
  
  <p>ORA-06502: PL/SQL: numeric or value error: character to number conversion error
  ORA-06512: at line 146
  06502. 00000 -  "PL/SQL: numeric or value error%s"</p>
  
  <p>And here's my code:</p>
  
  <pre><code>   SET SERVEROUTPUT ON;
  
  DECLARE
      SearchId NUMBER := 0;
      SearchMethod VARCHAR2(100) := '';
      CritExpression VARCHAR2(100) := '';
      SubstringStartPosition NUMBER := 0;
      SubstringLength NUMBER := 0;
      CritDescription VARCHAR2(100) := '';
      CriteriaSequenceId NUMBER := 1;
      CriteriaId NUMBER := 0;
      CritCount NUMBER := 0;
  
  FUNCTION InsertSrchCriteria
  (
      SearchMethod IN VARCHAR2,
      CritExpression IN VARCHAR2,
      SubstringStartPosition IN NUMBER,
      SubstringLength IN NUMBER,
      CritDescription IN VARCHAR2,
      CriteriaSequenceId IN NUMBER,
      SearchId IN NUMBER
  )
      RETURN NUMBER
  IS
      C_Id NUMBER := 0;
  BEGIN
      SELECT COUNT (*) INTO CritCount FROM criteria_table WHERE search_id = SearchId AND criteria_sequence_id = CriteriaSequenceId;
  
      IF CritCount = 0
      THEN
          INSERT INTO criteria_table
              (
                  criteria_sequence_id,
                  search_id,
                  search_method,
                  expression,
                  substring_start_position,
                  substring_length,
                  description
              )
              VALUES
              (
                  CriteriaSequenceId,
                  SearchId,
                  SearchMethod,
                  CritExpression,
                  SubstringStartPosition,
                  SubstringLength,
                  CritDescription
              )
              RETURNING criteria_id INTO C_Id;
          IF C_Id &gt; 0
          THEN
              DBMS_OUTPUT.PUT_LINE ('Inserted ' || 'SearchId: ' || SearchId || ' @' || CriteriaSequenceId || ' successfully');
          ELSE
              DBMS_OUTPUT.PUT_LINE ('Not Inserted ' || 'SearchId: ' || SearchId || ' @' || CriteriaSequenceId);
          END IF;
      ELSE
          DBMS_OUTPUT.PUT_LINE ('Already exists ' || 'SearchId: ' || SearchId || ' @' || CriteriaSequenceId);
      END IF;
      RETURN C_Id;
  END InsertSrchCriteria;
  
  BEGIN
          SearchId = 5;
          CriteriaSequenceId := 1;
          SearchMethod := 'XPath';
          CritExpression := '//Expression/text()';
          SubstringStartPosition := null;
          SubstringLength := null;
          CritDescription := '';
  
          CriteriaId := InsertSrchCriteria  ****
          (
              CriteriaSequenceId,
              SearchId,
              SearchMethod,
              CritExpression,
              SubstringStartPosition,
              SubstringLength,
              CritDescription
          );
  END;
  </code></pre>
  
  <p>The error is occuring on the line with <em>*</em>*. I'm not quite too sure as to what is causing this error, any help?</p>