Datetime equivalent in TD

General
Highlighted
Enthusiast

Datetime equivalent in TD

Hi,

 

I am trying to insert datetime value from oracle to the timestamp column in teradata.

 

Sample source value:

2019-05-30 05:32:06

 

Tried these options:

target column format as,

Timestamp(0)

Timestamp(0) with timezone

TIMESTAMP(0) WITH TIME ZONE FORMAT 'YYYY-MM-DDBHH:MI:SS'

Also, tried timestamp(6) with timezone and format.

 

But nothing seems to insert the data. Casting is not possible while insert in this case. 

 

Please suggest what could be stopping this to load.

 

Thanks!

 

 

1 REPLY 1
Teradata Employee

Re: Datetime equivalent in TD

Hi Phoenix,

 

Timestamp(0) without timezone (implicit) is what you need.

You have several ways to set a timestamp : literal, ANSI casting, to_timestamp function (same as in Oracle), TD casting :

select timestamp '2019-05-30 05:32:06'                              as ts1
     , cast('2019-05-30 05:32:06' as timestamp(0))                  as ts2
, to_timestamp('2019-05-30 05:32:06', 'yyyy-mm-dd hh24:mi:ss') as ts3
, '2019-05-30 05:32:06' (timestamp(0)) as ts4;