Timestamp with Microseconds in Parallel

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
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

Timestamp with Microseconds in Parallel

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

Post by devanars »

Can't we write any code in the ds job! to get microseconds also.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? You've already got the microseconds... not really sure what you're asking here.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What format string are you using in DataStage for the timestamp?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Re: Timestamp with Microseconds in Parallel

Post 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
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Re: Timestamp with Microseconds in Parallel

Post 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")
Post Reply