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!

to_number error

IQMay 2 2016 — edited May 2 2016

Hello,

   I have a SQL Query where I am trying to use to_number on a varchar datatype column as in

select  to_number(trim(replace(replace("Bead Amount xxb(mg/L)",'<'),'>'))) as amount

FROM  SAMPLE

I am getting an error ORA-01722: invalid number  ORA-02063: preceding line from  ND 01722. 00000 -  "invalid number" *Cause:    *Action:

Just to be sure if the data does not have any charaters in it, I even exported the data into a temp file and imported it back into a table containing NUMBER datatype, it worked correctly.

Can someone please take a look and advise if I am doing something wrong ?

Thanks

IQ

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 30 2016
Added on May 2 2016
6 comments
920 views