Thanks for the solutions, but the problem is I am creating flat spool file and I need the format for example from the left most start position like below:
0029025.00
Now if I use to_char function then it leaves 1 space from the left
0029025.00
And for some reason we can not change the sqlldr control file, we have to follow the bank standard provided format.
Please help to resolve this issue.
* You may not see one space blank left in this page, please run emp query to see what I am trying to explain.
One space on the left is the sign. If you try to convert negative number with to_char function you will see the minus sign rather than space.
select 'FORMAT: 000g000d00 PLUS ', to_char(23000.4, '000G000D00') from dual
union
select 'FORMAT: 000g000d00 MINUS ',to_char(-23000.4, '000G000D00') from dual
union
select 'FORMAT: S000g000d00 PLUS SIGN ',to_char(23000.4, 'S000G000D00') from dual
union
select 'FORMAT: S000g000d00 MINUS SIGN',to_char(-23000.4, 'S000G000D00') from dual
RESULT :
FORMAT: 000g000d00 MINUS -023.000,40
FORMAT: 000g000d00 PLUS 023.000,40
FORMAT: S000g000d00 MINUS SIGN -023.000,40
FORMAT: S000g000d00 PLUS SIGN +023.000,40
To avoid the space you can try the 'FM'
select to_char( 2000,'FM000g000d00') from dual;
( try this with negative number)
Bookmarks