存储过程:
create or replace procedure spExecSQL_2(Sql_1 in varchar2,Sql_2 in varchar2,Rtn out integer) isbegin
savepoint point1;
execute Immediate Sql_1;
execute Immediate Sql_2;
commit;
Rtn:=0;
exception
when others then
rollback to savepoint point1;
return;
Rtn:=-1;
end spExecSQL_2;
调用存储过程代码:
public static int ExecSQLbyVar(DataOracleParamters dParam, string[] SQL)
{
dParam.Commandtype = CommandType.StoredProcedure;
dParam.CommandText = "spExecSQL_" + SQL.Length.ToString();
for (int i = 0; i < SQL.Length; i++)
{
dParam.Add(new OracleParameter("Sql_" + i.ToString(), OracleType.VarChar, 8000), SQL[i]);
} OracleParameter spReturnValue = new OracleParameter("Rtn", OracleType.Int32, 10);
spReturnValue.Direction = ParameterDirection.Output;
dParam.Add(spReturnValue); DAL.ExeSqlNonQuery(ConnStr.sConnString, dParam); return (int)dParam["Rtn"].Value;
}每次执行 DAL.ExeSqlNonQuery(ConnStr.sConnString, dParam);到这里总是出现以下错误:ORA-06550: 第 1 行, 第 7 列:
PLS-00306: 调用 'SPEXECSQL_2' 时参数个数或类型错误
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
spExecSQL_2
请各位帮忙看看是什么地方的问题呢?谢谢了
create or replace procedure spExecSQL_2(Sql_1 in varchar2,Sql_2 in varchar2,Rtn out integer) isbegin
savepoint point1;
execute Immediate Sql_1;
execute Immediate Sql_2;
commit;
Rtn:=0;
exception
when others then
rollback to savepoint point1;
return;
Rtn:=-1;
end spExecSQL_2;
调用存储过程代码:
public static int ExecSQLbyVar(DataOracleParamters dParam, string[] SQL)
{
dParam.Commandtype = CommandType.StoredProcedure;
dParam.CommandText = "spExecSQL_" + SQL.Length.ToString();
for (int i = 0; i < SQL.Length; i++)
{
dParam.Add(new OracleParameter("Sql_" + i.ToString(), OracleType.VarChar, 8000), SQL[i]);
} OracleParameter spReturnValue = new OracleParameter("Rtn", OracleType.Int32, 10);
spReturnValue.Direction = ParameterDirection.Output;
dParam.Add(spReturnValue); DAL.ExeSqlNonQuery(ConnStr.sConnString, dParam); return (int)dParam["Rtn"].Value;
}每次执行 DAL.ExeSqlNonQuery(ConnStr.sConnString, dParam);到这里总是出现以下错误:ORA-06550: 第 1 行, 第 7 列:
PLS-00306: 调用 'SPEXECSQL_2' 时参数个数或类型错误
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
spExecSQL_2
请各位帮忙看看是什么地方的问题呢?谢谢了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货