pcs110 2017-03-20 09:40 采纳率: 50%
浏览 4742
已采纳

MYBATIS 批量update 报错的问题

批量update,很简单的sql语句,可是一直在报错。不知道为什么,求助!!!

close="" separator=";">
update student_point_level s
set s.score = #{item.score}
where s.id = #{item.id}


按照打印出来的sql,贴到front里运行的也都是对的....

Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update student_point_level s

        set s.score = 16
        where s.id = 19' at line 7

The error may involve com.supert.st.dao.StudentPointLevelMapper.updateStudentPointLevelBatch-Inline

The error occurred while setting parameters

SQL: update student_point_level s set s.score = ? where s.id = ? ; update student_point_level s set s.score = ? where s.id = ?

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update student_point_level s

        set s.score = 16
        where s.id = 19' at line 7

; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update student_point_level s
set s.score = 16
where s.id = 19' at line 7

  • 写回答

4条回答 默认 最新

  • pcs110 2017-03-21 03:33
    关注

    经过朋友的帮助,此问题已经解决。
    参考:http://www.cnblogs.com/hyq0002013/p/6077847.html

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
  • ¥50 invest生境质量模块