Page 1 of 1

Timestamp with Microseconds in Parallel

Posted: Tue Mar 03, 2009 1:33 pm
by devanars
I have Timestamp like 2008-02-28 19:50:32.428586 in db2. I need to convert this in to oracle target db like Timestamp with micro seconds. can any one help me giving sugessions.
when i keep taget datatype as timestamp it is giving like 2008-02-28 19:50:32.000000000AM. but i need with microseconds.

Thanks

Posted: Tue Mar 03, 2009 1:44 pm
by chulett
You should be able to take that value directly into Oracle with the TO_TIMESTAMP() function provided your Oracle TIMESTAMP field was created with that fractional seconds precision. Luckily, 6 is the default so more than likely you should be ok there.

I would think you should keep the target datatype as a varchar for this.

Posted: Tue Mar 03, 2009 2:38 pm
by devanars
Can't we write any code in the ds job! to get microseconds also.

Posted: Tue Mar 03, 2009 3:07 pm
by chulett
:? You've already got the microseconds... not really sure what you're asking here.

Posted: Tue Mar 03, 2009 3:24 pm
by ray.wurlod
What format string are you using in DataStage for the timestamp?

Re: Timestamp with Microseconds in Parallel

Posted: Tue Mar 03, 2009 3:29 pm
by betterthanever
if you are coneverting from a string to a timestamp format with microseconds ..try palying around with changing the default timestamp format in the job properties -->defaults section

Re: Timestamp with Microseconds in Parallel

Posted: Tue Mar 03, 2009 5:15 pm
by betterthanever
keep the data type as timestamp and select (micro seonds) in the extended property of the column...

in you are doing transformation in the transformer(if you extracted the column as a string from db2) ..use the string to timestamp function like this..

Code: Select all

StringToTimestamp(DSLink2.name(ex:2008-02-28 19:50:32.428586),"%yyyy-%mm-%dd %hh:%nn:%ss.6")