I need to execute a procedure in the database (Oracle) that returns me a character (S or N), I'm using the ODP.NET driver, I've tried everything and I could not do this, I even looked at several answers right here in SO PT and OS EN as well.
I put the code below to inform you that command type is a procedure.
cmd.CommandType = System.Data.CommandType.StoredProcedure;
I gave the output parameter:
OracleParameter param = cmd.Parameters.Add("p_retorno", OracleDbType.Varchar2);
param.Direction = System.Data.ParameterDirection.Output;
I tried to get the return like this:
string retorno = cmd.Parameters["p_retorno"].Value.ToString();
like this:
string retorno = (string)cmd.ExecuteScalar();
and so:
OracleDataReader data = cmd.ExecuteReader();
string retorno = data.GetString(0);
But the return variable is always empty, the proc is executed normally but I can not get the return.