Hi,
I have 2 source columns
Column1 (Char8)=20060624
Column2(Char6)=174911
I need to write to an oracle table as a timestamp, is there a function I can use in Modify stage to either concatenate or convert the source columns to single timestamp output column?
Thanks,
Concatenate/Convert date and time to timestamp
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
After date_from_string() and time_from_string() in one Modify stage you will need a second Modify stage to apply timestamp_from_date(). Two adjacent Modify stages are not permitted so you will need a Copy stage between them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
Instead of two modify stages and one copy satge , is it not better to use one transformer?
In the transformer, the below function works with dummy time
StringToTimestamp(To.SrcDate: " 000000","%yyyy%mm%dd %hh%nn%ss")
but when I replace the " 000000" with a column it gives me *********
StringToTimestamp(To.SrcDate: To.SrcTime,"%yyyy%mm%dd %hh%nn%ss")
The SrcTime has values like 124643,130216,125553.
Thanks for the help.
In the transformer, the below function works with dummy time
StringToTimestamp(To.SrcDate: " 000000","%yyyy%mm%dd %hh%nn%ss")
but when I replace the " 000000" with a column it gives me *********
StringToTimestamp(To.SrcDate: To.SrcTime,"%yyyy%mm%dd %hh%nn%ss")
The SrcTime has values like 124643,130216,125553.
Thanks for the help.
Thanks,
Vinay
Vinay
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
Hi,
I have got it working with the below format in a transformer, I was missing the space between the two columns when I concatenate them.
StringToTimestamp(To.SrcDate:' ':To.SrcTime,"%yyyy%mm%dd %hh%nn%ss")
Old format was
StringToTimestamp(To.SrcDate:To.SrcTime,"%yyyy%mm%dd %hh%nn%
ss")
Now will see if I can get it working in one Modify stage.
Thanks
I have got it working with the below format in a transformer, I was missing the space between the two columns when I concatenate them.
StringToTimestamp(To.SrcDate:' ':To.SrcTime,"%yyyy%mm%dd %hh%nn%ss")
Old format was
StringToTimestamp(To.SrcDate:To.SrcTime,"%yyyy%mm%dd %hh%nn%
ss")
Now will see if I can get it working in one Modify stage.
Thanks
Thanks,
Vinay
Vinay
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: