title: Error in executing Oracle Stored Procedure using C#
body: <p>I am trying to execute an Oracle stored procedure (1 input and 2 out parameters) using C#. </p>
  
  <p>My table contain 3 columns; an integer <code>id</code>, and 2 varchar2 type columns.</p>
  
  <p>This is table definition: </p>
  
  <pre><code>CREATE TABLE TESTTABLE 
  (
    ID INT Not Null,
    FNAME VARCHAR2(200),
    LNAME VARCHAR2(200),
    Constraint PK Primary Key (ID)
  );
  </code></pre>
  
  <p>This is my stored procedure:</p>
  
  <pre><code>create or replace PROCEDURE TESTP 
  (
    tempID IN TESTTABLE.ID%Type,
    tempName Out TESTTABLE.NAME%TYPE,
    tempLName out TESTTABLE.LNAME%TYPE
  ) 
  AS 
  BEGIN
      select Name, LNAME 
      into tempName, tempLName 
      from TestTable 
      where ID = tempID;
  END;
  </code></pre>
  
  <p>Here is the code to execute this procedure from C#:</p>
  
  <pre><code>try
  {
              Int32 id = 1;
              string FName = "", LName = "";
  
              using (_ora.GetOracleConnection())
              {
                  Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand("TESTP", _ora.GetOracleConnection());
                  cmd.CommandType = CommandType.StoredProcedure;
  
                  cmd.Parameters.Add("tempId", Oracle.DataAccess.Client.OracleDbType.Int32,ParameterDirection.Input).Value = id;
                  cmd.Parameters.Add("tempName", Oracle.DataAccess.Client.OracleDbType.Varchar2,200,ParameterDirection.Output).Value = FName;
                  cmd.Parameters.Add("tempLName", Oracle.DataAccess.Client.OracleDbType.Varchar2,200,ParameterDirection.Output).Value = LName;
  
                  cmd.ExecuteNonQuery();
              }
  }
  catch (Exception ex) 
  { 
       MessageBox.Show(ex.ToString());   
  }
  </code></pre>
  
  <p>This is the exception generated:</p>
  
  <blockquote>
    <p>Oracle.DataAccess.Client.OracleException ORA-06502: PL/SQL: numeric or value error<br>
    ORA-06512: at "USMANDBA.TESTP", line 9</p>
  </blockquote>
  
  <p>Can anyone help me ?</p>