如何在java程序中取得存储过程的返回参数?
CREATE PROCEDURE proc @pin varchar(6),@pout int OUTPUT
AS
SELECT @pout=count(f1) FROM t1 WHERE f2 in (SELECT f2 FROM t2 WHERE f3 in (SELECT f3 FROM t3 WHERE f4=@pin))
GO
------解决方案--------------------http://topic.csdn.net/t/20020224/13/539739.html
------解决方案----------------------参考代码:
DbParameters ps = new DbParameters();
DbParameter paraRet = new DbParameter( "Ret ", "int ", 4, ParameterDirection.ReturnValue, 0); --存储过程返回值
DbParameter para仓库编码 = new DbParameter( "@仓库编码 ", "varchar ", 20, ParameterDirection.Input, 仓库编码); --输入参数
DbParameter para单据类型 = new DbParameter( "@单据类型 ", "varchar ", 20, ParameterDirection.Input, 单据类型); --输入参数
DbParameter para单据编号 = new DbParameter( "@单据编号 ", "varchar ", 50, ParameterDirection.Output, strRet); --输出参数
ps.Add(paraRet);
ps.Add(para仓库编码);
ps.Add(para单据类型);
ps.Add(para单据编号);
//调用存储过程
base.DataBase.RunSQLProcedure( "SP_CreateNumber ", ps);
strRet = para单据编号.Value.ToString();
------解决方案--------------------copy
http://topic.csdn.net/t/20020224/13/539739.html