DB2 to Oracle Timestamp conversions

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
hema177
Participant
Posts: 19
Joined: Fri Apr 07, 2006 12:29 pm
Location: Edinburgh

DB2 to Oracle Timestamp conversions

Post by hema177 »

Hi

Enterprise doesn't seem to use Oconv etc for Timestamp conversions. Would be grateful if anyone can give me any ideas regarding converting timestamps from DB2 source to Oracle Target. I can't get the transformer to compile at all if I try doing just a straight -through copy. Error says "Error in output column derivation expression for column RETURN_DT in link toOracleUpdates. Invalid conversion requested from a date to a timestamp."

Any suggestions?
emma
Premium Member
Premium Member
Posts: 95
Joined: Fri Aug 08, 2003 10:30 am
Location: Montreal

Post by emma »

First search the PX forum for Oconv, there is something that could help you.
Thanks,
Emma
thumsup9
Charter Member
Charter Member
Posts: 168
Joined: Fri Feb 18, 2005 11:29 am

Post by thumsup9 »

You cant use OCONV in Parallel jobs.one way to do this is to do TimestampToString and then StringToTimestamp functions to migrate DB2 timestamp to Oracle Timestamp.

StringToTimestamp(TimestampToString(inputdate,%yyyy-%mm-%dd %hh:%nn:%ss),%yyyy-%mm-%dd %hh:%nn:%ss)

Check the format of timestamp in Both DB2 and oracle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If it's a timestamp, it should be able to copy straight through (perhaps with an adjustment to the fractional seconds).

[Oconv() does not work with timestamps even in server edition.]
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hema177
Participant
Posts: 19
Joined: Fri Apr 07, 2006 12:29 pm
Location: Edinburgh

Post by hema177 »

ray.wurlod wrote:If it's a timestamp, it should be able to copy straight through (perhaps with an adjustment to the fractional seconds).

[Oconv() does not work with timestamps even in server edition.] ...
Hi Ray,

Thanks for this. It's able to copy straight through if I change the Target datatypes in the transformer to 'Date' instead of 'TimeStamp'. I am using DRS Stage as Source (DB2) and Oracle Stage as Target. Not sure what the issue is.

Thanks Again.

Hema
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Oracle also doesn't have a specific TimeStamp data type. All Date data types are stored with time component.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply