PL/SQL numeric or value error in C#

May 17 2013 4:59 AM
 Hi

i am trying to retrieve a value from my database through a stored procedure. i get a PL/SQL numeric or value error when i run the code.

PL/SQL

   create or replace
   PROCEDURE PROD_PASSWORD 
   (
     PR_USERNAME IN VARCHAR2  
   , PWORD OUT VARCHAR2  
   ) AS 
   BEGIN
     select p_password into pword from tbl_personnel where p_username = pr_username;
   END PROD_PASSWORD;

C#

   string oradb = "Data Source=localhost:1521/XE;User Id=system;Password=Blue1960;";

   OracleConnection conn = new OracleConnection(oradb); // C#

   conn.Open();

   OracleCommand cmd = new OracleCommand("PROD_PASSWORD", conn);
   cmd.BindByName =
true;
   cmd.CommandType =
CommandType.StoredProcedure;

   cmd.Parameters.Add(
"PR_USERNAME", OracleDbType.Varchar2, txtUsername.Text, ParameterDirection.Input);
   cmd.Parameters.Add(
"PWORD", OracleDbType.Varchar2, ParameterDirection.ReturnValue);

   cmd.ExecuteNonQuery();

   txtPassword.Text = cmd.Parameters[
"PWORD"].Value.ToString();

   conn.Dispose();

Thanks in advance

Answers (2)