Loading Integer in Db2 issue

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sam334
Premium Member
Premium Member
Posts: 145
Joined: Mon Aug 26, 2013 7:42 pm

Loading Integer in Db2 issue

Post by sam334 »

Hi, Need a help on loading four digit code number from SQL to DB2 database. In input SQL db the code column data type is (Varchar,4) and output db2 database it is Integer.

The issue is that, in SQL db if an number is 0837, in output DB2 its loading as 837. Its a straight column mapping.

Thanks.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Leading zeroes will be removed from Int columns. If you want to have leading zero, then define it as varchar column in DB2
You are the creator of your destiny - Swami Vivekananda
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

In other words, you have no issue and it is doing exactly what it should be doing. Another alternative is to convert it back to a char when you select it from the DB2 table if that leading zero is needed / significant.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sam334
Premium Member
Premium Member
Posts: 145
Joined: Mon Aug 26, 2013 7:42 pm

Post by sam334 »

Thanks a lot. I changed it.. working fine now....Appreciate your help..
Post Reply