Error in converting to To_number
686041Mar 14 2009 — edited Mar 14 2009i'm using an employee table in which the phone number is stored as a character.. eg: 515.123.4567. i want to extract the last 8 numbers and convert it into a number format..
i user the following query..
select substr(phone_number,-8) from employees
and
select to_number(substr(phone_number,-8),'999.9999')*10000 Local_number from employees -- if i use this it says that ORA-01722 invalid number error..
but the following query
select to_number(substr(phone_number,-8),'999.9999')*10000 local_numbe from employees where department_id<=50 is working properly
but if i gve
select to_number(substr(phone_number,-8),'999.9999')*10000 local_numbe from employees where department_id<=150 --it throwing the same error, though dept 150 is nt thre in my table it should display the lesser, right?
'm using 9i database and in toad i executed these queries
regards renji