Archives of the TeradataForum
Message Posted: Tue, 04 May 2010 @ 11:58:27 GMT
In file, I am getting data as 20161017 i.e. date and 4 spaces if proper timestamp is not present. There are some blank and spaces are also present in other records.
I am trying to load data by:
,CASE WHEN CHARACTERS(TRIM(:EMI_PRE_CLR_DTE))>8 THEN CAST(:EMI_PRE_CLR_DTE AS TIMESTAMP(0)) WHEN CHARACTERS(TRIM(:EMI_PRE_CLR_DTE))=8 THEN CAST(CAST(SUBSTR(:EMI_PRE_CLR_DTE,1,4) ||'-'|| SUBSTR(:EMI_PRE_CLR_DTE,5,2) ||'-'|| SUBSTR(:EMI_PRE_CLR_DTE,7,2) AS CHAR(10))|| CAST(' 00:00:00' AS CHAR(9)) AS TIMESTAMP(0)) ELSE CAST( '2010-09-01 00:00:00'AS TIMESTAMP(0)) END
But it s not working its giving error msg as 5407: Invalid operation on an ANSI Datetime or Interval Could you please suggest correct way of loading timestamp in table?
Thanks & Regards,
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|