MySQL 语法错误: insert into spareplan 语句错误 - 解决方法
{"title":"Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@19b44cdf]
19-Jul-2023 10:58:22.304 淇℃伅 [http-nio-8080-exec-6] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
org.springframework.jdbc.BadSqlGrammarException:
19-Jul-2023 10:58:22.331 淇℃伅 [http-nio-8080-exec-6] org.springframework.jdbc.support.SQLErrorCodesFactory.
Error updating database. Cause: java.sql.SQLSyntaxErrorException: 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 '' at line 13
The error may involve com.xm.mapper.SparePlanMapper.addSparePlanInfo-Inline
The error occurred while setting parameters
SQL: insert into spareplan( dec_as_num, item_num, item_name, storage_status, storage_num, outbound_status, outbound_num, dispatch_status, plan_status, item ) values
Cause: java.sql.SQLSyntaxErrorException: 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 '' at line 13
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: 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 '' at line 13,是怎么回事内容:这个错误是由于在执行数据库更新操作时出现了SQL语法错误导致的。具体错误信息是: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 '' at line 13。
根据错误信息推测,可能是在执行插入语句时,SQL语句的语法有问题。请检查你的MySQL服务器版本,并仔细检查插入语句的语法,确保语法正确性。
另外,根据日志信息,还可以看到错误发生在SparePlanMapper接口的addSparePlanInfo方法的执行过程中,错误发生在设置参数的过程中。
请检查并修正插入语句的语法错误,以解决这个问题。
原文地址: https://www.cveoy.top/t/topic/pTYA 著作权归作者所有。请勿转载和采集!