问题描述
客户端代码:try{i=WebSvr.svr.CHECK05DOCPLU(docno,textBox1.Text.Trim(),outqty,outerrmsg);}catch(ExceptionE1){Program.MsgDlgOK(E1.Message);return;}客户端存根注册:publicintCHECK05DOCPLU(stringp_docno,stringp_bcd,outintp_qty,outstringerrmsg){object[]results=this.Invoke("CHECK05DOCPLU",newobject[]{p_docno,p_bcd});p_qty=((int)(results[1]));errmsg=((string)(results[2]));return((int)(results[0]));WEBSERVER端:publicintCHECK05DOCPLU(stringp_docno,stringp_bcdno,outintqty,outstringerrmsg)//CREATEORREPLACEPROCEDURERF_CHECK05DOCPLU(P_DOCNOINVARCHAR2,P_BCDNOINVARCHAR2,P_QTYOUTINTEGER,P_RETURNOUTINTEGER)AS{inti=0;errmsg=string.Empty;qty=0;conn.Open();OracleCommandcmd=newOracleCommand("RF_CHECK05DOCPLU",conn);OracleTransactiontran=conn.BeginTransaction();try{cmd.CommandType=System.Data.CommandType.StoredProcedure;cmd.Parameters.Add("P_DOCNO",OracleType.VarChar,20);cmd.Parameters["P_DOCNO"].Value=p_docno;cmd.Parameters.Add("P_BCDNO",OracleType.VarChar,20);cmd.Parameters["P_BCDNO"].Value=p_bcdno;OracleParameterp_qty=cmd.Parameters.Add("P_QTY",OracleType.Int32);p_qty.Direction=System.Data.ParameterDirection.InputOutput;OracleParameterp_return=cmd.Parameters.Add("P_RETURN",OracleType.Int32);p_return.Direction=System.Data.ParameterDirection.InputOutput;cmd.Transaction=tran;cmd.ExecuteNonQuery();tran.Commit();qty=Convert.ToInt32(p_qty.Value);i=Convert.ToInt32(p_return.Value);}catch(ExceptionE1){tran.Rollback();errmsg=E1.Message;}finally{conn.Close();cmd.Dispose();tran.Dispose();}returni;}总是提示上面错误,,,小弟找不到原因,,确定参数类型和个数没问题:下面是相应的ORACAL服务器端过程:CREATEORREPLACEPROCEDURERF_CHECK05DOCPLU(P_DOCNOINVARCHAR2,P_BCDNOINVARCHAR2,P_QTYINOUTINTEGER,P_RETURNINOUTINTEGER)AS--参数说明:判断返配单中该商品是否存在、是否已验收完毕。若商品存在且未验收完毕,返回未验收箱数--P_DOCNO:反配单号--P_PLUNO:商品编码--P_QTY:未验收数量V_SELECTINTEGER;V_DOCNOVARCHAR2(20);V_CTYPINTEGER;V_REVIDINTEGER;V_PLUIDINTEGER;V_NQTYNUMERIC(9,3);BEGINV_DOCNO:=P_DOCNO;V_PLUID:=0;SELECTCOUNT(1)INTOV_SELECTFROMDOC05BFWHEREDOCNO=V_DOCNO;IFV_SELECT<=0THEN--RAISE_APPLICATION_ERROR(-20000,'在验证返配单'||V_DOCNO||']时出错,无法找到反配单.');P_RETURN:=-1;RETURN;ENDIF;SELECTCTYP,REVIDINTOV_CTYP,V_REVIDFROMDOC05BFWHEREDOCNO=V_DOCNO;SELECTPLUIDINTOV_PLUIDFROMvwbasbcdWHEREBCD=P_BCDNO;SELECTCOUNT(1)INTOV_SELECTFROMDOC05DTWHEREDOCNO=V_DOCNOANDPLUID=V_PLUID;IFV_SELECT<=0THEN--RAISE_APPLICATION_ERROR(-20000,'在验证商品['||P_BCDNO||']时出错,在单据['||V_DOCNO||']中无法找到此商品.');P_RETURN:=-2;RETURN;ENDIF;IFV_REVID>0THEN--RAISE_APPLICATION_ERROR(-20000,'单据['||V_DOCNO||']已验货完毕!.');P_RETURN:=-3;RETURN;ENDIF;SELECTQTY-NVL(NQTY,0)INTOV_NQTYFROMDOC05DTWHEREDOCNO=V_DOCNOANDPLUID=V_PLUID;IFV_NQTY<=0THEN--RAISE_APPLICATION_ERROR(-20000,'商品['||P_BCDNO||']已验货完毕!.');P_RETURN:=-4;RETURN;ELSEP_QTY:=V_NQTY;ENDIF;/*IFV_CTYP=1THENENDIF;*/COMMIT;P_RETURN:=1;ENDRF_CHECK05DOCPLU;请教。。。。
解决方案
解决方案二:
看着这么多代码好烦