zoukankan      html  css  js  c++  java
  • sql中更新数据库用到declare @a in

    declare @a in

    update TB_Class set @a=1,name='李小龙' where ID=1

    这样就可以像更新哪个就更新哪个了

    例如ibatisnet中需要更新的时候:

     <update id="Update" parameterClass="OrderStatusNeedSendToCps">
          <!--update N_OrderStatusNeedSendToCps
          set
          OrderStatus=#OrderStatus#
          ,CpsCode=#CpsCode#
          ,ContentType=#ContentType#
          ,IsSendToCps=#IsSendToCps#
          ,SendTime=getdate()
          ,ErrMessage=#ErrMessage#
          where Id=#Id#-->
          
          
          declare @a int
          update N_OrderStatusNeedSendToCps set @a=1
          <dynamic>
            <isNotNull prepend="," property="OrderStatus">
              OrderStatus=#OrderStatus#
            </isNotNull>
            <isNotNull prepend="," property="CpsCode">
              CpsCode=#CpsCode#
            </isNotNull>
            <isNotNull prepend="," property="ContentType">
              ContentType=#ContentType#
            </isNotNull>
            <isNotNull prepend="," property="IsSendToCps">
              IsSendToCps=#IsSendToCps#
            </isNotNull>
            <isNotNull prepend="," property="SendTime">
              SendTime=getdate()
            </isNotNull>
            <isNotNull prepend="," property="ErrMessage">
              ErrMessage=#ErrMessage#
            </isNotNull>
          </dynamic>
          where Id=#Id#
        </update>
    View Code
  • 相关阅读:
    用Canvas绘制一个钟表
    用css3做一个3D立方体
    函数调用的不同方式,以及this的指向
    Javascript 严格模式use strict详解
    前端开发页面的性能优化方案总结
    Promise对象解读
    Vue爬坑之vuex初识
    WEB前端性能优化小结
    navicat 注册码
    docker
  • 原文地址:https://www.cnblogs.com/1003487863qq/p/3382793.html
Copyright © 2011-2022 走看看