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 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试