Skip to Main Content

Database Software

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!

SQL LOADER LPAD CONTROL FILE QUESTION

449465Aug 28 2012 — edited Aug 28 2012
Hi, inthe flat file
company_cd is "1" or "01"
and center_cd is 3 digits... ex: "493"

in the table the userid coulmn should be 6 digits

currently i am getting this as userid in the table

"010493" is right, because company_cd is "01"
"10493" is not right, because company_cd is "1"

if company_cd is 2 digits(01) i am getting 6 digits userid which is OK
but when company_cd is singile digit(1) i am getting 5 digits userid

I NEED TO LPAD with 0 in the front when company_cd is "1"any suggetions ???????



***********This is the code i am using currently in the CTL file for userid**********

,USERID "CONCAT(substr(trim(:company_cd),1,2),lpad(trim(:center_cd),4,0))"


.......Thank You..........

Edited by: phani_Marella on Aug 28, 2012 11:12 AM
This post has been answered by Hoek on Aug 28 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2012
Added on Aug 28 2012
3 comments
1,643 views