zoukankan      html  css  js  c++  java
  • 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 NAME=@NAME
    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 NAME=@NAME
    set IDENTITY_INSERT USERINFO OFF
    SELECT 1
    END

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

    OK

  • 相关阅读:
    [kuangbin带你飞]专题1-23
    ES code study
    ES特点
    CENTOS7命令
    ES单机版安装
    ES安装手册
    数据库三大范式(1NF,2NF,3NF)及ER图
    win10下Spark的环境搭建
    MySQL安装详细图解整理
    MySQL中format()函数
  • 原文地址:https://www.cnblogs.com/yixing/p/9027866.html
Copyright © 2011-2022 走看看