您的位置:首頁技術文章
文章詳情頁

java - mybatis,調用存儲過程,“setselect”附近有語法錯誤。

瀏覽:155日期:2023-12-31 09:43:51

問題描述

mybatis,調用存儲過程,“setselect”附近有語法錯誤。

<select resultMap='BaseResultMap' parameterType='com.unisits.zngkpt.framework.highwayreport.pojo.ReportType' statementType='CALLABLE'> {call Get_TrafficData_Report ( #{reportTimeType,mode=IN,jdbcType=VARCHAR},#{reportFunction,mode=IN,jdbcType=VARCHAR},#{year,mode=IN,jdbcType=INTEGER},#{month,mode=IN,jdbcType=INTEGER},#{day,mode=IN,jdbcType=INTEGER},#{tunnelId,mode=IN,jdbcType=INTEGER} )}</select>

把參數直接改成 ’Day’, ’JTLL’, 2015, 06, 15, 0就沒有問題。

完整log

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: ### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: “setselect”附近有語法錯誤。### The error may exist in file [D:zngkptcodezngkptoutartifactshighway_war_explodedWEB-INFclassesmappersqlserverTrafficReportStatic.xml]### The error may involve com.unisits.zngkpt.framework.highwayreport.mapper.TrafficReportDao.getTrafficReportData-Inline### The error occurred while setting parameters### SQL: {call Get_TrafficData_Report ( ?, ?, ?, ?, ?, ? )}### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: “setselect”附近有語法錯誤。

問題解答

回答1:

存儲過程報錯,直接把報錯的參數用來調試存儲過程就知道什么問題了

標簽: java
相關文章:
国产综合久久一区二区三区