Date format: time being truncated

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
tricampeon81
Participant
Posts: 19
Joined: Thu Apr 19, 2018 11:06 am
Location: chile
Contact:

Date format: time being truncated

Post 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?
dfgdfg
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply