日期:2014-05-16  浏览次数:21080 次

用pl/sql developer查询时报‘无效的数字’错误
今天用pl/sql developer查询时出错了。sql语句如下:
select t.* from t_user_test t where t.t_dept = 48000148400 and t.t_user=790000561;
报‘无效数字’错误,把 and t.t_user=790000561 去掉就能查询出来,把790000561改成‘790000561’也能查询出来。
那个t_dept和t_user都是varchar2(100)类型的,怎么t_dept就没错?搞不懂为什么。

------解决方案--------------------
SQL code

SQL> create table test1(id        varchar2(200));
 
Table created
SQL> insert into test1 values('1');
 
1 row inserted
SQL> commit;
 
Commit complete
SQL> select * from test1 where id = 1;
 
ID
--------------------------------------------
1
SQL> insert into test1 values('-');
 
1 row inserted
SQL> commit;
 
Commit complete
SQL> select * from test1 where id = 1;
 
select * from test1 where id = 1
 
ORA-01722: 无效数字