Hi Dieter,
Can you please explain below (I encountered it in our code - generated through Informatica) -- colname is a varchar(24) unicode
CAST(
(
CASE WHEN ((CHARACTER_LENGTH(tablename.colname) = 8)
AND (tablename.colname <> '00000000')) THEN
CAST(tablename.colname AS TIMESTAMP FORMAT 'YYYYMMDD')
ELSE CAST('00010101' AS TIMESTAMP FORMAT 'YYYYMMDD')
END
) AS date)
Instead of casting the colname in both cases to timestamp and then to date, it can be done directly to date as below.
CAST(
(
CASE WHEN ((CHARACTER_LENGTH(tablename.colname) = 8)
AND (tablename.colname <> '00000000')) THEN
tablename.colname
ELSE '00010101'
END
) AS date format 'YYYYMMDD')
Not sure, what caused them to follow the above one. Is it due to Informatica
Hi Dieter,
Can you please explain below (I encountered it in our code - generated through Informatica) -- colname is a varchar(24) unicode
Instead of casting the colname in both cases to timestamp and then to date, it can be done directly to date as below.
Not sure, what caused them to follow the above one. Is it due to Informatica