java - mybatis,调用存储过程,“setselect”附近有语法错误。
天蓬老师
天蓬老师 2017-04-18 10:54:52
0
1
740

mybatis,调用存储过程,“setselect”附近有语法错误。

<select id="getTrafficReportData" 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:\zngkpt\code\zngkpt\out\artifacts\highway_war_exploded\WEB-INF\classes\mapper\sqlserver\TrafficReportStatic.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)
PHPzhong

存储过程报错,直接把报错的参数用来调试存储过程就知道什么问题了

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!