iBATIS 你懂的

mlgb12355 2013-10-11 09:49:18
異常信息:
--- The error occurred while applying a parameter map.
--- Check the productionMasterPlan.getStartweek-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-00911: 无效字符

<select id="getStartweek" parameterClass="String" resultClass="String">
select decode(tt.D,to_char('sunday'),tt.W,tt.w+1) from
(with t as(select to_date(to_char('2010/10/01'),'YYYY/MM/DD')+level-1 dt from dual connect by level <=31)
select dt,to_char(dt,'ww')w,trim(to_char(dt,'day')) d from t) tt where rowNum=1;
</select>
那個時間是參數
在toad裏面能正常執行
...全文
88 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
无敌小二傻 2013-10-11
  • 打赏
  • 举报
回复
如果时间是字符类型的,就不要在用to_char了,直接to_date to_date(to_char('2010/10/01'),'YYYY/MM/DD') 改为: to_date('2010/10/01','YYYY/MM/DD')
manniP 2013-10-11
  • 打赏
  • 举报
回复
引用 2 楼 dengsilinming 的回复:
LZ试试这样呢:to_char(#时间参数#),'YYYY/MM/DD')
試過了。我一開始就是這樣寫的,一直報Cause: java.sql.SQLException: ORA-00911: 无效字符 這個異常
dengsilinming 2013-10-11
  • 打赏
  • 举报
回复
LZ试试这样呢:to_char(#时间参数#),'YYYY/MM/DD')
manniP 2013-10-11
  • 打赏
  • 举报
回复

17,078

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧