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