Issue when writing Timestamp with milli seconds to 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
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

Issue when writing Timestamp with milli seconds to DB2

Post by nsm »

Hi ,

I tried 2 different methods.


1)ODBC Enterprise: Get the Timestamp with Microseconds use the left 23 characters and then concatenate "000" to end so,
it will have 6 second digits.Passing data to ODBC Enterprise as a varchar worked but the issue with ODBC enterprise is
I couldn't pass rejects sqlcode to a reject file.

Did anybody succeeded passing the SQLCODE down to somewhere from the Rejects link? wanted to see if we need a patch?

2)To have the reject code I went back to use ODBC Connector where I can't really pass the varchar to Timestamp.
I did try using the "StringToDate" and "StringToTime" function but couldn't get them to work with milli seconds.

For Ex: String I have "2009-06-09 12:12:12.123000" then no matter what I do I will end up with "2009-06-09 12:12:12.000000"
(Note: I do have Extended(Microseconds) property set up with for each Timestamp field).

Any idea on what needs to be done?

Thanks
nsm
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

have you defined scale for that field? If not define it as 6 however no need to define length of the field.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
BradMiller
Premium Member
Premium Member
Posts: 87
Joined: Mon Feb 18, 2008 3:58 pm
Location: Sacramento, CA

Post by BradMiller »

Try this... In your ODBC Enterprise stage, go to the Columns tab. Right click anywhere in the grid and select Properties. Check the check box next to 'Extended' and click 'OK'. Back on the grid, in your column identified as TimeStamp, drop down the list box under Extended and choose MicroSeconds. Your milli-seconds will then be included.
Post Reply