Page 1 of 1

Issue when writing Timestamp with milli seconds to DB2

Posted: Tue Jun 09, 2009 8:40 am
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

Posted: Tue Jun 09, 2009 9:00 am
by priyadarshikunal
have you defined scale for that field? If not define it as 6 however no need to define length of the field.

Posted: Tue Jun 09, 2009 11:33 am
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.