ORA-06550 wrong number or types of arguments when calling Oracle stored procedure

We struggled with this for two days, and I am very upset, but I feel that I am moving forward. After reviewing Oracle online docs, I'm here. Getting error while executing code:

ORA-06550: row 1, column 15: PLS-00306: wrong number or argument types when calling 'P_SALTEDHASH' ORA-06550: row 1, column 7: PL / SQL: expression is ignored

The stored procedure is as follows:

PROCEDURE stored_procedure_name ( p_passwd IN VARCHAR2, p_salt IN VARCHAR2, p_saltedhash_passwd OUT VARCHAR2 ) 

My code is:

  string stored_procedure_name = "stored_procedure_name"; // create the command object OracleCommand cmd = conn.CreateCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = stored_procedure_name; cmd.BindByName = true; //Oracle Parameters necessary for the p_saltedhash function cmd.Parameters.Add("p_passwd", p_passwd); cmd.Parameters.Add("p_salt", p_salt); OracleParameter p_saltedhash_passwd = new OracleParameter("p_saltedhash_passwd", OracleDbType.Varchar2); p_saltedhash_passwd.Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(p_saltedhash_passwd); // execute the pl/sql block cmd.ExecuteNonQuery(); Response.Write("Pin hash is: " + p_saltedhash_passwd);` 
+4
source share
1 answer

change

 p_saltedhash_passwd.Direction = ParameterDirection.ReturnValue; 

to

 p_saltedhash_passwd.Direction = ParameterDirection.Output; 
+4
source

Source: https://habr.com/ru/post/1380642/


All Articles