MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » ordinal parameter mismatch错误(高分)

ordinal parameter mismatch错误(高分)

www.MyException.Cn  网友分享于:2013-01-30  浏览:94次
ordinal parameter mismatch异常(高分)
我的这个   SQL语句报了ordinal   parameter   mismatch异常,有碰到过这个异常的   朋友给个解决办法,我写出SQL语句,大家看了   别晕,有更好SQL语句代替这个的也给分

select   ii.seq,ii.itemId,ii.title,ii.type,ii.displayRelationalLink,ii.relationalLink,ii.counter,ii.titleColor,ii.titlePic  
from  
InfoItem   as   ii,InfoColumn   as   ic,InfoColumnItem   as   ici,InfoTemplateParaInst   as   itpi  
where    
itpi.paraName   =   '是否需要审批 '   and   itpi.paraValue   =   '0 '   and   itpi.templateInstSeq   =   ic.templateInstanceSeq   and   ic.seq   =   ici.columnSeq   and   ici.itemSeq   =   ii.seq   and   ii.title   like   ?   and   ii.publishTime   between   to_date(?, 'yyyy-mm-dd ')   and   to_date(?, 'yyyy-mm-dd ')   and   ii.lastModifier   like   ?   and   ii.publisher   like   ?   and   ii.keyword   like   ?  
union  
select   ii.seq,ii.itemId,ii.title,ii.type,ii.displayRelationalLink,ii.relationalLink,ii.counter,ii.titleColor,ii.titlePic  
from
  InfoItem   as   ii,InfoColumn   as   ic,InfoColumnItem   as   ici,InfoTemplateParaInst   as   itpi,InfoItemAuditing   as   iia  
where  
itpi.paraName   =   '是否需要审批 '   and   itpi.paraValue   =   '1 '   and   itpi.templateInstSeq   =   ic.templateInstanceSeq   and   ic.seq   =   ici.columnSeq   and   ici.itemSeq   =   ii.seq   and   iia.auditingStatus   =   1   and   iia.itemSeq   =   ii.seq   and   ii.title   like   ?   and   ii.publishTime   between   to_date(?, 'yyyy-mm-dd ')   and   to_date(?, 'yyyy-mm-dd ')   and   ii.lastModifier   like   ?   and   ii.publisher   like   ?   and   ii.keyword   like   ?


就是两个普通的查询union了起来,用了12个参数,请高手赐教

------解决方案--------------------
把sql放在SQL里直接执行有没有问题?
------解决方案--------------------
学习一下。。。

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有