Hi,
PFA code snippet :-
Cursor cur_1 Is
Select lb.*
From tab1 lb;
begin
................
For i in cur_1 LOOP
utl_file.putf(fp,'%s',LTRIM (To_Char(NVL(i.ID,0),'09999999999')));
utl_file.putf(fp,'%s',To_Char(NVL(i.rate,' '), 'S0999999V9999'));
utl_file.putf(fp,'%s',To_Char(NVL(i.amount,' '), 'S0999999V9999'));
end loop;
end;
In the output file , if the column value for rate is NULL then it is not adding spaces. As a result the output is not properly alligned.
Sample output
000464247078
5908540 <--- this is not uniform because NVL is replacing null with space.
cheers
subhotech
000000066400
PFA code snippet :-
Cursor cur_1 Is
Select lb.*
From tab1 lb;
begin
................
For i in cur_1 LOOP
utl_file.putf(fp,'%s',LTRIM (To_Char(NVL(i.ID,0),'09999999999')));
utl_file.putf(fp,'%s',To_Char(NVL(i.rate,' '), 'S0999999V9999'));
utl_file.putf(fp,'%s',To_Char(NVL(i.amount,' '), 'S0999999V9999'));
end loop;
end;
In the output file , if the column value for rate is NULL then it is not adding spaces. As a result the output is not properly alligned.
Sample output
000464247078
5908540 <--- this is not uniform because NVL is replacing null with space.
cheers
subhotech
000000066400