| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> decimal formatting in file output
Hi,
i've oracle 8.1.7.0.0 running on a sun solaris system,
i'm in Italy so i suppose there is the italian configuration for
decimal format.
I need to print to file some numerical data,
if i run the query:
Connesso a:
Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
With the Partitioning option
JServer Release 8.1.7.0.0 - Production
SQL> SELECT rate -- number (38,12)
2 FROM AL_ACTIVITY
3 WHERE loan_id = 24501 ;
RATE
,2
i use this command to print to file:
UTL_FILE.PUT_LINE(id_file_rend,buf);
and i need the leading ZERO before of comma, something like this
0,2
i used the TO_CHAR in this way:
SQL> select rate,TO_CHAR(rate,'0.0000')
2 from al_activity
3 where activity_type = 'LV'
4 and input_date = TRUNC(SYSDATE);
RATE TO_CHAR
---------- -------
1,5 1.5000
1 1.0000
1 1.0000
,2 0.2000
,1 0.1000
,2 0.2000
That's good for the leading number, but i do't want to show others zero
not-significant,
![]() |
![]() |