现有一个SQL2008存储过程如下,[email protected],@y
返回 一个结果集,一个output参数,一个return参数.
- SQL code
alter proc sp111 ( @x int, @y int, @z int output ) as begin declare @r int select @[email protected][email protected],@r=@x-@y select @x*1 col union all select @y*1 col union all select @z*1 col return @r end
PB代码如下
- C# code
integer valx,valy,valz,valr,valo;valx=integer(sle_1.text);valy=integer(sle_2.text);lb_1.reset();lb_2.reset();declare spsub procedure for dbo.sp111 @x=:valx,@y=:valy,@z=:valz output;execute spsub;fetch spsub into :valz;do while SQLCA.SQLCode=0 lb_1.additem(string(valz)); fetch spsub into :valz;loopfetch spsub into :valr,:valo;sle_3.text=string(valr);if SQLCA.sqlcode=-1 then sle_3.text=sle_3.text+"_"+string(SQLCA.sqlerrtext);end ifclose spsub;
为何总是取不到return的值呢?测试过各种写法了,还是不行.望指点,感谢.
结果总提示: 0_Mismatch between retrieve columns and fetch columns
------解决方案--------------------
问题已经解决,可以正常访问该帖子