Oracle“ORA-00911: 无效字符”解决方式


在工作中碰到ORA-00911:无效字符的问题,

代码如下:

<select id="querySendMsg" parameterType="map" resultMap="sendMsgResult">
        select t.employee_code,t.phone_no,t.wechat_id,t.employee_name,t.send_msg,t.send_time from itsc_msg_abnormal_record t
        where t.orderNo in
        <foreach item="item" index="index" collection="orderNoList" open="(" separator="," close=")">
        #{item}
        </foreach>;
</select>

错误如下:

### The error occurred while setting parameters
### SQL: select t.* from itsc_msg_abnormal_record t where t.orderNo in ( ? , ? ) ;
### Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

发现是在select语句末尾多加了一个分号';'

去掉即可


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM