.net 访问 带有输出参数的存储过程,为什么无法获得输出参数值?

解决方案 »

  1.   


    127.0.0.1~root@localhost~test>delimiter //
    127.0.0.1~root@localhost~test>create procedure sp(a int,out b int)
        -> begin
        -> select a into b;
        -> end;
        -> //
    Query OK, 0 rows affected (0.00 sec)127.0.0.1~root@localhost~test>call sp(100,@a);
        -> //
    Query OK, 0 rows affected (0.00 sec)127.0.0.1~root@localhost~test>select @a //
    +------+
    | @a   |
    +------+
    |  100 |
    +------+
    1 row in set (0.00 sec)127.0.0.1~root@localhost~test>delimiter ;
    参考上面的存储过程,修改你的存储过程。
      

  2.   

    先在你的程序中 exceute ( "call proceduerName(xx,@yy"):
    紧跟着 execute ("select @yy") 行到返回参数的值。