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