TP5执行存储过程报The active result for the query contains no fields.

Posted 亦星

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了TP5执行存储过程报The active result for the query contains no fields.相关的知识,希望对你有一定的参考价值。

创建SqlServer存储过程

create procedure INSERT_USERINFO
@NAME varchar(16)
AS
BEGIN
--指定插入标识符的显式值
set IDENTITY_INSERT USERINFO ON
insert into USERINFO(USERID,NAME,BADGENUMBER) select USERID,NAME,BADGENUMBER from USERINFO_BEI where [email protected]
set IDENTITY_INSERT USERINFO OFF
END

php执行上面存储过程报错

 $pro = "exec INSERT_USERINFO " . $value[‘realname‘];
            $codeu = $db->query($pro); 

修改存储过程

create procedure INSERT_USERINFO
@NAME varchar(16)
AS
BEGIN
set nocount on
set IDENTITY_INSERT USERINFO ON
insert into USERINFO(USERID,NAME,BADGENUMBER) select USERID,NAME,BADGENUMBER from USERINFO_BEI where [email protected]
set IDENTITY_INSERT USERINFO OFF
SELECT 1
END

 $pro = "exec INSERT_USERINFO " . $value[‘realname‘];
            $codeu = $db->query($pro); //返回1

OK

 

以上是关于TP5执行存储过程报The active result for the query contains no fields.的主要内容,如果未能解决你的问题,请参考以下文章

ORACLE的存储过程执行报错

STS报could not find tools.jar in the active JRE

ORACLE 存储过程报错 PLS-00103 求查错

oracle存储过程中执行查询sql语句报错

oracle 执行有返回值的存储过程报错

应用存储过程执行报错解决方案