我正在尝试使用IDbConnection接口来调用存储过程以返回表类型。该数据库是一个orcale数据库。
C#代码
IDbConnection connection = DBFactory.CreateConnection();
connection.Open();
using (IDbCommand comm = connection.CreateCommand())
{
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = STORE_PROC;
IDbDataParameter param = comm.CreateParameter();
param.ParameterName = "P_INPUT";
param.DbType = DbType.String;
param.Value = "val";
IDbDataParameter paramOut = comm.CreateParameter();
paramOut.ParameterName = "P_OUTPUT";
paramOut.Direction = ParameterDirection.Output;
comm.Parameters.Add(param);
comm.Parameters.Add(paramOut);
comm.ExecuteNonQuery();
}
关于行comm.ExecuteNonQuery()我收到以下错误:
ORA-06550: Regel 1, kolom 7:
PLS-00306: wrong number or types of arguments in call
to 'name_stored_procedure'.
ORA-06550: Regel 1, kolom 7:
PL/SQL: Statement ignored
存储过程函数具有以下结构:
procedure name_stored_procedure
( p_input varchar2
, p_output out bes_bpr_tabtype
);
如何获取返回表类型的命令?