G
Guest
Hi,
I am trying to call an oracle function using Visual Studio .Net 2003. The
function runs fine Stand Alone. Only when I call it using my C# Code I get
the following error: "ORA-06550: wrong number or types of arguments in call
to FUNCTIONNAME". Hence I am assuming it has something to do with the way I
am calling the function. I am providing the same parameters as I am providing
it while running stand alone. So the parameter value should not be a problem.
decimal SchMSum;
string mySql;
conn = this.ConnObj;
DataSet ds = new DataSet();
OracleCommand comm = new OracleCommand();
mySql = "FunctionName";
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = mySql;
comm.Parameters.Clear();
comm.Parameters.Add(new OracleParameter("n_SRCE_SYS_NBR",
OracleType.Char)).Value = n_SRCE_SYS_NBR;
comm.Parameters.Add(new OracleParameter("n_PERIOD_NBR",
OracleType.Number)).Value = n_PERIOD_NBR;
comm.Parameters.Add(new OracleParameter("n_LE_AOO_SC",
OracleType.VarChar)).Value = n_LE_AOO_SC;
comm.Parameters.Add(new OracleParameter("SchMSum",
OracleType.Number)).Direction = ParameterDirection.ReturnValue;
try
{
SchMSum = decimal.Parse(comm.ExecuteScalar().ToString());
conn.Close();
}
catch (Exception e)
{
throw new Exception (e.Message );
}
finally
{
conn.Close();
}
return SchMSum;
Please help...the field SchMSum in the database is a number and I am using
"Decimal" for the associated .Net type.
Thanks
I am trying to call an oracle function using Visual Studio .Net 2003. The
function runs fine Stand Alone. Only when I call it using my C# Code I get
the following error: "ORA-06550: wrong number or types of arguments in call
to FUNCTIONNAME". Hence I am assuming it has something to do with the way I
am calling the function. I am providing the same parameters as I am providing
it while running stand alone. So the parameter value should not be a problem.
decimal SchMSum;
string mySql;
conn = this.ConnObj;
DataSet ds = new DataSet();
OracleCommand comm = new OracleCommand();
mySql = "FunctionName";
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = mySql;
comm.Parameters.Clear();
comm.Parameters.Add(new OracleParameter("n_SRCE_SYS_NBR",
OracleType.Char)).Value = n_SRCE_SYS_NBR;
comm.Parameters.Add(new OracleParameter("n_PERIOD_NBR",
OracleType.Number)).Value = n_PERIOD_NBR;
comm.Parameters.Add(new OracleParameter("n_LE_AOO_SC",
OracleType.VarChar)).Value = n_LE_AOO_SC;
comm.Parameters.Add(new OracleParameter("SchMSum",
OracleType.Number)).Direction = ParameterDirection.ReturnValue;
try
{
SchMSum = decimal.Parse(comm.ExecuteScalar().ToString());
conn.Close();
}
catch (Exception e)
{
throw new Exception (e.Message );
}
finally
{
conn.Close();
}
return SchMSum;
Please help...the field SchMSum in the database is a number and I am using
"Decimal" for the associated .Net type.
Thanks