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

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条)

报告相同问题?