Page 1 of 1

Conversion of String to Teradata Timestamp Format

Posted: Thu Jan 11, 2007 4:07 am
by saur_classic
Hi,

I am facing problem in Converting String to Timestamp.

The Job inserts into Teradata table which has a Date Column as
Cre_Dt TIMESTAMP(0) FORMAT 'YYYY-MM-DD HH:MI:SS'
and the Source file sends the Data in Format 'Mon Jan 08 00:00:00 EST 2007'.

In the transformer just before insertion into the table i need to convert it into the Format 'YYYY-MM-DD HH:MI:SS'

Linkname.Sourcecolumn[25,4]:Linkname.Sourcecolumn[5,15]
gives me '2007:Jan 08 00:00:00'

how to solve this problem?

Please help me

Posted: Thu Jan 11, 2007 1:19 pm
by I_Server_Whale
Using the Concatenation operator, you can get this close to your objective.

Code: Select all

 Linkname.Sourcecolumn[25,4]:'-':Linkname.Sourcecolumn[5,3]:'-':Linkname.Sourcecolumn[9,2]:' ':Linkname.Sourcecolumn[12,8]
will yield you

Code: Select all

Result = 2007-Jan-08 00:00:00
for

Code: Select all

Mon Jan 08 00:00:00 EST 2007
Since you are using EE/PX, you may need to build a C++ routine to convert the alphabetic month(Jan, Feb......) into numeric to achieve your objective.

Whale.