Hi all,
I have the following table:
desc INC_PER_YEAR
Name Null Type
----------------------- -------- ------------
COD_ORG NOT NULL CHAR(12)
YEAR NOT NULL CHAR(4)
VAL_INC NOT NULL NUMBER
The value of val_inc is a decimal withe 1 digiti on left of decimal separator and a variable number of digit on the rigth of decimal point.
ES:
0.1234567
1.234
Using a cursor like:
SELECT *
FROM INC_PER_YEAR
WHERE YEAR = parm_input
I need to write on a file ( using UTL_FILE procedure ) the following output:
COD_ORG|YEAR|VAL_INC
I use the following concat:
cur.COD_ORG||'|'||cur.YEAR||'|'||cur.VAL_INC
But VAL_INC look like
0.1234567 -> .1234567
1.234 -> 1.234
I already check the number format parameter of TO_CHAR, but how can I set the correct number of significant digit?
If I use TO_CHAR(0.1234567,'9.99999') I have 0.1234567 on file but when I use TO_CHAR(0.1234,'9.99999') I have 0.1234000.
Thanks for all and best regards