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!

fixed lenght or offset for columns

430921Oct 13 2010 — edited Oct 13 2010
i want to insert fixed length in between the records because i have to produce a text file with fixed
length like eg : empnum should be in 1 to 5 lenght and empnum from 6 to 25country if there is no data
space should resereved from 26 to 40 and so on.If the field is blank the space should be preserved i tried
lpad,ltrim,nvl but its not working

select lpad(' ',7,' ')||lpad(' ',24,' ')||lpad(nvl(trim(country),lpad('C',15,' ')),15,' ')
from emp_master

rgds
ramya
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 10 2010
Added on Oct 13 2010
6 comments
185 views