2

I have Oracle db with these inputs on column1(NUMBER(22,6)) in myTable.

0
199935,15
1026299

I want to display these columns like that:

00000000000000000.000000
00000000000199935.150000
00000000001026299.000000

My query:

SELECT trim(to_char(trim(replace(column1,',','.')),'9999999999999990.999999')) 
FROM myTable;

But Oracle shows this error. How can I fix?

01722. 00000 -  "invalid number"
*Cause:    The specified number was invalid.
*Action:   Specify a valid number.
Pronto
  • 179
  • 1
  • 2
  • 11

1 Answers1

3

If you have a numeric column, all you have to do is use a to_char with the right parameters; this should do the work:

select to_char(column1, '00000000000000000D000000', 'NLS_NUMERIC_CHARACTERS = ''.,''') from ...
Aleksej
  • 22,443
  • 5
  • 33
  • 38