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!

Invalid Number

2817195Apr 4 2017 — edited Apr 4 2017

Hi friends,

Need help with the below select query..

select n_curr, to_number(replace(trim(regexp_replace(nvalue,'[) $[:alpha:]]','')),'(','-')) nvalue from net_prof

where contract_no='415';

n_curr           nvalue

-------          ------

($6.00)              -6

($20.70)          -20.7

$16.20             16.2

$19.00               19

($230.48)       -230.48

  If n_curr value has 4 or more digits like $1,155.00 I get an invalid number error..  I'm not sure if this is because of the comma.. Result should be

n_curr               nvalue

--------               --------

$1,155.00           1155

Please help.. Thanks a lot in advance

This post has been answered by Chris Hunt on Apr 4 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 2 2017
Added on Apr 4 2017
5 comments
301 views