TIMESTAMP values gets updated with UTC values via Stored procedure.

Database
Enthusiast

TIMESTAMP values gets updated with UTC values via Stored procedure.

We have the column defined as below

beg_ts TIMESTAMP(6) WITH TIME ZONE.

The column when updated via BTEQ, MACRO gives the output as below

8/21/2015 23:22:55.320000-07:00 (at local timezone)

when updated via stored procedure gives the output

UTC Time - 8/22/2015 06:22:39.360000+00:00 (at gmt)

Also the same procedure on a different DB region gives the local timezone

I'm not sure what is causing the value to be updated as "gmt" when done via SP but not via BTEQ, Macro..

2 REPLIES
Teradata Employee

Re: TIMESTAMP values gets updated with UTC values via Stored procedure.

DML requests (including macro execution) submitted directly will default to the current session time zone.

But within a SQL Stored Procedure, DML defaults to the time zone of the session which compiled the SP.

Enthusiast

Re: TIMESTAMP values gets updated with UTC values via Stored procedure.

Thanks Fred . The SP seems to have been recompiled with UTC. We re-compiled again with "AT local" using ALTER and it worked as expected.