Problem with db2 date

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
ravij
Premium Member
Premium Member
Posts: 170
Joined: Mon Oct 10, 2005 7:04 am
Location: India

Problem with db2 date

Post by ravij »

Hi,

I have a column of char(8)(format is like : DDMMYYYY) coming from Seq file and I need to convert it into Date(Date format is: YYYY-MM-DD) and load into DB2 db. When I tried convert the src column into internal format using Iconv in Trnsf stage and used Oconv in another Trnsf stage and load it into db its failed.
In Icov I used Like: Iconv(in.date,"DDMY") and
In Oconv I used like: Oconv(in.date,"D-YMD[4,2,2]")

I am getting the error like:
CopyOfSFIPFactFncChkRetAnl21..Copy_of_trns_ChkRetanl: MSR_PRD_ID = 12007 SRO_ID = 1 OPR_ID = 31 SRC_STM_ID = 2 CHK_RET_DT = NULL CHK_RET_AMT = 3 CHK_RET_VAL = 13936.10
CopyOfSFIPFactFncChkRetAnl21..Copy_of_trns_ChkRetanl: [IBM][CLI Driver][DB2/AIX64] SQL0407N Assignment of a NULL value to a NOT NULL column "TBSPACEID=55, TABLEID=8, COLNO=4" is not allowed. SQLSTATE=23502
Please help to solve this problem.
Ravi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I've tried to help. Twice now. Perhaps third time is the charm - leave the date in internal format and sent that to the DB2 stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ravij
Premium Member
Premium Member
Posts: 170
Joined: Mon Oct 10, 2005 7:04 am
Location: India

Post by ravij »

Thanks Chulett,

I got the solution.. able to load the date into db2.
Ravi
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Chulett, you were right, third time was the charm :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply