Page 1 of 1

Date format: time being truncated

Posted: Wed Jul 04, 2018 10:33 am
by tricampeon81
Friends, I have the following problem:

SELECT TO_DATE(TO_CHAR(B.START_DATE,'DD-MM-YYYY HH24:MI:SS'),'DD-MM-YYYY HH24:MI:SS') START_DATE, FROM table1

Output:
23-06-2018 13:50:56

But when you insert it in the other table it does so as:

23-06-2018

Why?

Posted: Wed Jul 04, 2018 3:13 pm
by chulett
What is the actual target system and data type?

AFAIK, only Oracle DATE fields support a time portion, otherwise the time gets truncated. And it looks like you already have a DATE in your source so not sure why you are doing the TO_CHAR/TO_DATE dance. Especially since this is marked as a Server job. Have you tried simply moving the field from source to target without any shenanigans?

Posted: Wed Jul 04, 2018 11:30 pm
by ray.wurlod
You could try setting the Data Element for that column to Timestamp.

Other than that, keep the timestamp as a string within DataStage.