How to default a Timestamp Field?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

How to default a Timestamp Field?

Post by deepa_shenoy »

Hi,

I want to deafult a Timestamp field to ''12/31/9999 00:00:00"

How would I do this in a Transformer stage?

I tried:
StringToTimestamp('12/31/9999 00:00:00',"mm/dd/yyyy hh:nn:ss")


TimestampFromDateTime(StringToDate('12/31/9999',"mm/dd/yyyy"), StringToTime('00:00:00',"%hh:%nn:%ss"))

Both did not work correctly. A fatal error was thrown.

How to resolve this issue?

Thanks in advance.

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

Post by ray.wurlod »

WHERE did you try StringToTimestamp() function?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post by deepa_shenoy »

I gave it in the derivation column within the Transformer.

I got the solution though.

This works: TimestampFromDateTime(StringToDate('9999-12-31',"%yyyy-%mm-%dd"), StringToTime('00:00:00',"%hh:%nn:%ss"))
Post Reply