oracle 異常字符串轉數字(ora-01722錯誤)


oracle中,在字符串轉成數字時,如果字段中存在不能轉成功的內容,將會報ora-01722錯誤,解決方法如下:

select ziduan from table;

1

2

3

4a

5

select case when REGEXP_INSTR(ziduan,'[^[:digit:]]{1,}',1)=0 then to_number(ziduan) end ziduan_new from table;

1

2

3

null

5


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM