调用oracle存储过程时,传递的参数被截断了?

来源:百度知道 编辑:UC知道 时间:2024/04/28 05:08:28
OracleCommand oc = new OracleCommand("PK_GET_COMPARE_RESULT.PROC_GET_COMPARE_RESAULT",conn);
oc.CommandType = CommandType.StoredProcedure;

OracleParameter p1=new OracleParameter("strClientIP",OracleType.VarChar,100);
p1.Direction=ParameterDirection.Input;
p1.Value=clientIP;
logger.Info(p1.Value);//这里打印出的参数长度是正确的

OracleParameter p2 = new OracleParameter("strPcsm", OracleType.VarChar,50);
p2.Direction=ParameterDirection.Input;
p2.Value=qryCondition.QryID;
logger.Info(p2.Value););//这里打印出的参数长度是正确的

OracleParameter p3=new OracleParameter("Re_CURSOR",OracleType.Cursor);
p3.Direction=ParameterDirection.Output;

oc.Parameters.Add(p1);
oc.Parameters.Add(p2);
oc

用动态的SQL就行了

1. 先把输入的表名,拼写成"select * from <表>"
2. prepare a for <SQL语句>
3. declare cursor for a;
4. open cursor ...
5. fetch records...
6. close cursor...

end.