I have a table with numbers stored as varchar2
with '.' as decimal separator (e.g. '5.92843').
I want to calculate with these numbers using ',' as that is the system default and have used the following to_number
to do this:
TO_NUMBER(number,'99999D9999','NLS_NUMERIC_CHARACTERS = ''.,''')
My problem is that some numbers can be very long, as the field is VARCHAR2(100)
, and when it is longer than my defined format, my to_number
fails with a ORA-01722
.
Is there any way I can define a dynamic number format? I do not really care about the format as long as I can set my decimal character.