I wrote this procedure in Oracle 11g:
create or replace
PROCEDURE P1
(
ID_1 IN NUMBER
, P_NAME OUT VARCHAR2
) AS
BEGIN
SELECT NAME_ into p_name FROM A1 WHERE ID=ID_1;
END P1;
and I wrote this code in C# to call the procedure:
OracleConnection conn = new OracleConnection("User Id=webservice_access;Password=DAMAVAND;Server=ORA11;");
//OracleConnection conn = new OracleConnection("User Id=SYSTEM;Password=123456;Server=ORA11;");
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "P1";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("ID_1", 1);
cmd.Parameters.Add("p_name", OracleType.VarChar, 16).Direction = ParameterDirection.Output;
cmd.Connection.Open();
cmd.ExecuteNonQuery();
Console.WriteLine(cmd.Parameters["p_name"].Value.ToString());
cmd.Connection.Close();
but when I run the C# application I get this error:
ORA-06512:at "WEBSERVICE_ACCESS.P1",Line 10
ORA-06512:at line 1
What happened? Why do I get that error?