Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> decimal formatting in file output

decimal formatting in file output

From: siddhana <siddhana_at_gmail.com>
Date: 20 Nov 2006 04:49:44 -0800
Message-ID: <1164026984.880988.98290@b28g2000cwb.googlegroups.com>


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,

please suggest me the solution to both show the leading number is rate is < 1 and how to trim the not important zero, thank you so much, all you are great!!!
love
siddhana Received on Mon Nov 20 2006 - 06:49:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US