Timestamp column returns wrong values for microseconds

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
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Timestamp column returns wrong values for microseconds

Post by bkumar103 »

Hi,
I have developed a job to load data from one table to another where source is Teradata Enterprise Stage and target is Teradata TPump Stage with a Transformer stage in between.
I have a timestamp column whose input value say, 2008-04-11 08:00:03.963901 which gets changed to 2008-04-11 08:00:03.000000 at the output. But when i view data at the source stage, the value is just perfect.
I tried changing the timestamp column to Varchar, still the same problem persists. Using Sequential file stage also doesn't help :(

Can somebody help me solve this problem?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No. YOU need to investigate where the fractional seconds are disappearing. Put a Peek stage on every link. Or compile in trace mode, which is effectively the same thing. Only run a few rows in the latter case.

You must also be honest about anything you are doing with this field as it passes through the Transformer stage.
Last edited by ray.wurlod on Fri Aug 15, 2008 12:31 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

I explicitly converted the timestamp column to char in the source stage and it works fine now.

Thanks ray :)
ParagM
Participant
Posts: 1
Joined: Tue Apr 01, 2008 7:42 am

Re: Timestamp column returns wrong values for microseconds

Post by ParagM »

bkumar103 wrote:Hi,
I have developed a job to load data from one table to another where source is Teradata Enterprise Stage and target is Teradata TPump Stage with a Transformer stage in between.
I have a timestamp column whose input value say, 2008-04-11 08:00:03.963901 which gets changed to 2008-04-11 08:00:03.000000 at the output. But when i view data at the source stage, the value is just perfect.
I tried changing the timestamp column to Varchar, still the same problem persists. Using Sequential file stage also doesn't help :(

Can somebody help me solve this problem?

Hi ,

Yo can use StringToTimstamp function in Transformer stage.
The default is %hh:%nn:%ss, or, if extended to include microseconds, %hh:%nn:%ss.x where x gives the number
of decimal places seconds is given to.A timestamp can include the components for date and time above. The default
format is %yyyy-%mm-%dd %hh:%nn:%ss, or, if extended to include microseconds, %yyyy-%mm-%dd %hh:%nn:%ss.x where x
gives the number of decimal places seconds is given to.

Thanks
Mani
toshea
Participant
Posts: 79
Joined: Thu Aug 14, 2008 6:46 pm

Post by toshea »

If you have the data type set to Timestamp, then you need to set the Extended attribute to Microseconds, otherwise the microseconds will get truncated.
Post Reply