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
Conversion of String to Teradata Timestamp Format
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 9
- Joined: Tue Aug 01, 2006 9:43 pm
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Using the Concatenation operator, you can get this close to your objective.
will yield you
for
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.
Code: Select all
Linkname.Sourcecolumn[25,4]:'-':Linkname.Sourcecolumn[5,3]:'-':Linkname.Sourcecolumn[9,2]:' ':Linkname.Sourcecolumn[12,8]
Code: Select all
Result = 2007-Jan-08 00:00:00
Code: Select all
Mon Jan 08 00:00:00 EST 2007
Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE