Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Rpad(NVL(null,' '),10) in utl_file

623086Dec 3 2009 — edited Dec 4 2009
Hi Team,

I was working on UTL_FILE, I have a problem like when i am printing some columns using utl_file as follows

EX: UTL_FILE.PUT_LINE(file_handle,RPAD(nvl(col1,' '),9)||';'||RPAD(NVL(COL2,' '),5)||';'||RPAD(NVL(COL3,' '),7));

if col2 is null then the values are overlapping with each other as follows

Current Problem:
COL1 COL2 COL3
1232343231 32479832 3248726324
1231232132 21371233 2131232133
2132131233 2131232133
1321231233 21321321 2131231232
1232132132 2132132133

can anybody help me,how to allign these column in proper order with spaces if null value returned using UTL_FILE
Requirement Example
COL1 COL2 COL3
1232343231 32479832 3248726324
1231232132 21371233 2131232133
2132131233 2131232133
1321231233 21321321 2131231232
1232132132 2132132133


Thanks & Regards,
Sriram.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2010
Added on Dec 3 2009
6 comments
4,323 views