且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ORA-06550:在ASP.NET中的oracle包内调用函数时,错误的数字或参数类型错误

更新时间:2022-12-03 13:56:13

您在代码中使用了其他名称作为参数.尝试更改

You're using a different name for the parameter in your code. Try changing

ename.ParameterName = "ename";

ename.ParameterName = "P_ename";

ALSO

您需要为输出值添加一个参数:

You need to add a parameter for the output value:

OracleParameter result = new OracleParameter();
result.OracleType = OracleType.VarChar;
result.Direction = ParameterDirection.ReturnValue;
orclCmnd.Parameters.Add(result);

使用ExecuteNonQuery调用函数后,从参数中获取值:

And get the value from the parameter after calling the function with ExecuteNonQuery:

orclCmnd.ExecuteNonQuery();
strResult = result.Value.ToString();