当前位置: 代码迷 >> QT开发 >> qt如何获取存储过程的返回值
  详细解决方案

qt如何获取存储过程的返回值

热度:138   发布时间:2016-04-25 05:05:11.0
qt怎么获取存储过程的返回值?
存储过程:
SQL code
ALTER proc [dbo].[sp_test]@a intasbegin    select * from Categories where CategoryID = @a    select @a;end

用query执行存储过程后query.value(0)返回的是空。


------解决方案--------------------
你的存储过程里面有2个select语句,试试bool QSqlQuery::nextResult ()获取第二个select的结果。
------解决方案--------------------
你的问题本身就是答案了呢
------解决方案--------------------
探讨
存储过程:

SQL code

ALTER proc [dbo].[sp_test]
@a int
as
begin
select * from Categories where CategoryID = @a
select @a;
end

用query执行存储过程后query.value(0)返回的是空。
  相关解决方案