Skip to Main Content

Oracle Database Discussions

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!

string to number conversion

Sami A.Jun 12 2019 — edited Jun 13 2019

i am trying to read a string  with commas and decimal point in it as number . if the string only has a comma it reads it fine and coverts it to number but if the string has comma and

decimal point both then it doesnt read it.

SQL> alter session set NLS_NUMERIC_CHARACTERS = ',.';

Session altered.

SQL> select to_number('100,12') from dual;

TO_NUMBER('100,12')

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

             100,12

SQL> select to_number('100,12.99') from dual;

select to_number('100,12.99') from dual

                 *

ERROR at line 1:

ORA-01722: invalid number

Comments
Post Details
Added on Jun 12 2019
3 comments
6,766 views