Oracle批量更新数据,使用begin end

/* 使用begin end批量更新   注意end后面必须使用;结束 并且每条update语句都要用;来结束  所以close为;END; 是为了补全语法 */
 <foreach collection="list" item="item" index= "index" open="BEGIN" close=";END;" separator =";">
      update xxxx
          <set>
              xxxx = 100
          </set>
          <where>
               ID = 'xxxx'
          </where>
  </foreach>

注意的点:

  1.begin end 必须成对出现

  2.end后面必须跟;结束

  3.每一条语句都要以;结束

所以close是 ;END; 是为了补全语法

参考[1]:https://blog.csdn.net/aaronmer/article/details/80576191

posted @ 2019-01-04 13:56  HaniLucky  阅读(5228)  评论(0编辑  收藏  举报