Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01722: invalid number

user650888Nov 19 2009 — edited Nov 20 2009
create  table tab_varc(user_data_15 varchar2(15))

create table tab_wf (loan_num number)

insert into tab_wf values (2)
/
insert into tab_varc values ('2')

/
insert into tab_varc values ('#')
/
commit
/


select a.USER_DATA_15
from tab_varc a
where a.USER_DATA_15 in (select loan_num from tab_wf) 
when i give the above select, i get ORA-01722 error, the data
in tab_varc is bad, and it has millions of rows, so I do not know
how to find out the bad data

is there a way to make the above query work?

i tried this
select a.USER_DATA_15
from tab_varc a
where to_number(a.USER_DATA_15) in (select loan_num from tab_wf) 
it did not work
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2009
Added on Nov 19 2009
6 comments
10,990 views