2. 列举可能导致"invalid number"错误的常见原因 数据类型不匹配:查询中尝试将字符串类型的字段与数字类型的字段进行比较或计算。 函数使用不当:在使用如TO_NUMBER这类函数时,传递给函数的字符串包含非数字字符。 隐式类型转换:Oracle在某些情况下会尝试自动将字符串转换为数字,如果字符串内容不符合数字格
语句本身一看就知道会出问题,因为3没加引号,会被当作数字处理。这样就肯定会报ORA-01722: invalid number的错误:SQL Error: 1722, SQLState: 42000 ORA-01722: invalid number 但在用hibernate时,为了避免数字问题,我们经常会这样写hsql语句:String sql = 'select * from ctEntity as ct where ...
再和where segment4=41030000进行比较判断,如果能够确保segment4字段里面存放的全为数字那么这个语句是一直不会报错的(可能存在效率问 题),但偏偏系统设置了预算,在segment4里面加入了几个字母BUDGET,如果还是上面的语句, 当查询扫描到41030000时to_char(mdn)报错ORA-01722 invalid number 2. 因此写SQL语句的时候最好...
Oracle-ORA-01722invalidnumber错误忽然有⼀天,好好的系统报错:ORA-01722 invalid number 环境:Oracle9 + JDBC访问数据库,之前是好的,忽然发现这个错误 1. 代码⾥⾯执⾏了如下SQL语句:select mdn from tablename where mdn=138*** tablename表⾥⾯的mdn字段是varchar2()类型字段,由于Oracle的字段...
select*from表名wherenvl2(translate(字段名,'/1234567890','/'),'CHAR','NUMBER')='CHAR' 2.正则表达式函数 REGEXP_SUBSTR 处理,将数据进行过滤,ok! --条件语句:whereREGEXP_SUBSTR(t1.operatorid,'[0-9]+')ISNOTNULL--示例:selectt1.operatorid,t2.equ_group,max(last_login) last_loginfrom表 t1...
估计是没有空格的原因吧,试试下面的,有问题再追问。declarechoice number;t_t number;t_l varchar(5);t_n varchar(5);now_left number;
ORA-01722 invalid number很容易理解,无须多言,一般发生在显式的to_number()类型转换的参数错误时。 前几天我也遇到了一个由于直觉作怪而差点被忽略了的ORA-01722错误。 http://davidyu720.itpub.net/post/31716/291191http://davidyu720.itpub.net/post/31716/291191 ...
忽然有一天,好好的系统报错:ORA-01722 invalid number 环境:Oracle9 + JDBC访问数据库,之前是好的,忽然发现这个错误 后来参考了:http://davidyu720.itpub.net/post/31716/291191才知道缘由 1. 代码里面执行了如下SQL语句: select mdn from tablename where mdn=13800000000 ...
I am getting "Oracle database error 1722: ORA-01722: invalid number" when I am trying to refresh the extracts. I debugged into the issue and found there is a value which is stored as a string in oracle database and I am converting that into numeric value. For example "Result" is ...
忽然有一天,好好的系统报错:ORA-01722 invalid number 环境:Oracle9 + JDBC访问数据库,之前是好的,忽然发现这个错误 后来参考了:http://davidyu720.itpub.net/post/31716/291191才知道缘由 1. 代码里面执行了如下SQL语句: select mdn from tablename where mdn=13800000000 ...