Page 1 of 1

Timestamp column returns wrong values for microseconds

Posted: Sun Apr 13, 2008 10:59 pm
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?

Posted: Sun Apr 13, 2008 11:10 pm
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.

Posted: Mon Apr 14, 2008 1:09 am
by bkumar103
I explicitly converted the timestamp column to char in the source stage and it works fine now.

Thanks ray :)

Re: Timestamp column returns wrong values for microseconds

Posted: Mon Apr 14, 2008 1:12 am
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

Posted: Fri Aug 15, 2008 12:29 am
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.