我在oracle procedure
中有这个更新语句规格:
PROCEDURE Update_G;
体:
PROCEDURE Update_G
AS
BEGIN
UPDATE group SET check_flag = 0 WHERE check_flag = 1;
UPDATE employee SET check_flag = 0 WHERE check_flag = 1;
END Update_G;
当我从.net调用它的抛出错误时这个程序:
PLS-00306: wrong number or types of arguments in call to Update_G
它从oracle运行,但从.net运行它的抛出错误。如果添加输入参数,它可以工作,但我不需要任何参数。
Dot Net Code:
Database db = GetOracleDbInstance();
object[] spParams = new object[0];
string spName = "Update_G";
db.ExecuteDataSet(spName, spParams);
//这里没有参数,我也尝试了这个:
Database db = GetOracleDbInstance();
db.ExecuteNonQuery(CommandType.StoredProcedure, "Update_G");
答案 0 :(得分:0)
//过程所需的参数,如果没有参数则传递Null
Database db = GetOracleDbInstance();
string spName = "Update_G";
db.ExecuteDataSet(spName, Null); //or db.ExecuteDataSet(spName); try both