StringToTimestamp convert

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
techsavy
Participant
Posts: 26
Joined: Sat Jan 10, 2015 11:11 am
Location: India

StringToTimestamp convert

Post by techsavy »

Hi everyone,

Just want to clear my concept on implicit vs explicit conversion of string to timestamp.

If my input is varchar and output is timestamp, shall I need to explicit convert through StringToTimestamp()? I hope datastage convert this implicity.

Which one is better? whether let datastage do implicit conversion or use explicit convert function.

Please suggest
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You will use explicit conversion, because there is no implicit conversion of string to timestamp.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
techsavy
Participant
Posts: 26
Joined: Sat Jan 10, 2015 11:11 am
Location: India

Post by techsavy »

Ray, but if we dont explict cast it and let it varchar till load stage, it wont show any error/warning.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It will when your string isn't a valid timestamp.
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