Insert 24:00:00 value into time field on DB2

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dsdevper
Premium Member
Premium Member
Posts: 86
Joined: Tue Aug 19, 2008 9:31 am

Insert 24:00:00 value into time field on DB2

Post by dsdevper »

Hi ,

I am getting 24:00:00 from a time field on DB2 ,and i have to insert the same value into a time field on DB2.

I am getting following error when trying to insert this value into DB2 table.

"TABLE1_Insert,0: Warning: At row 2, link "toxfmDefault", while processing column "TIME_UPDATE"
Attempt to convert Long value "86400" to Time type unsuccessful"
Ravi.K
Participant
Posts: 209
Joined: Sat Nov 20, 2010 11:33 pm
Location: Bangalore

Re: Insert 24:00:00 value into time field on DB2

Post by Ravi.K »

Please check your meta data at source whether the field meta data is time or not. if it is time at source then try to use convert functions.
Cheers
Ravi K
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well... don't know DB2 but there's no such hour as "24"... unless that's a DB2 thing. Seems like it should be "00" instead. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Ravi.K
Participant
Posts: 209
Joined: Sat Nov 20, 2010 11:33 pm
Location: Bangalore

Post by Ravi.K »

I also agree with Craig.

Normally 24 hours Clock Boundry is as follows.

00:00:00 to 23:59:59
Cheers
Ravi K
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I think we've talked about this before... ah, here it is... it does seem to be a valid DB2 value but DataStage (and others) don't agree so you'll need to explicitly test for it and convert it to "00:00:00".
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsdevper
Premium Member
Premium Member
Posts: 86
Joined: Tue Aug 19, 2008 9:31 am

Post by dsdevper »

Thanks Chulett,

I have gone thru the post what you have mentioned, there they have converted 24:0:00 to next day, but in may case as i am migrating a C# code where it is inserting 24:00:00,Client wants to do the same they dont want to convert it to next day.

Any idea of how to insert the same value...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not sure why they felt it was any kind of 'next day', in my mind 24:00:00 and 00:00:00 are functionally the same thing - midnight. If you don't need to change the date then don't.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply