I am calling a function from oracle package which will return a string as below
using(OracleConnection con = AppConn.Connection)
{
OracleCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
cmd.CommandText = "select P_Pkg.found(@p_id) from dual";
OracleParameter p_id = new OracleParameter();
p_id.OracleDbType = OracleDbType.Int64;
p_id.Direction = ParameterDirection.Input;
p_id.Value = requestHeader.approval_id;
cmd.Parameters.Add(p_id);
try
{
con.Open();
string found = cmd.ExecuteScalar().ToString();
}
catch(Exception ex)
{
}
finally
{
con.Close();
}
}
but i am getting the below error . I can't find the problem after a lot of search. Please help.
ORA-06550: line 1, column 51:
PL/SQL: ORA-00936: missing expression
ORA-06550: line 1, column 7:
Function signature in oracle
P_Pkg.found(p_id IN NUMBER)
RETURN varchar2 //(YES , NO)
I run this from oracle as below and got the result with out any error
select P_Pkg.found(1053) from dual
CommandTextto justP_Pkg.foundand then add the parameter giving it the correct name? (p_id)