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
saikiran
Premium Member
Posts: 18 Joined: Wed Aug 20, 2008 11:28 pm
Post
by saikiran » Sat Sep 13, 2008 3:49 pm
Hello DSgurus,
I need to convert the source column which is in format hh:nn:ss to timestamp.Souce is sequential file and the target is oracle table.Can anyone crack this
Thank you
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Sat Sep 13, 2008 4:06 pm
Can't you just wrap this in a TO_DATE function in the INSERT statement?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sat Sep 13, 2008 4:36 pm
hh:nn:ss? nn? Am I missing something or did you mean hh:mm:ss? And what are you planning on doing for a date... or did you mean an Oracle
INTERVAL field rather than a TIMESTAMP?
-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 » Sat Sep 13, 2008 10:03 pm
It's not necessary to have multiple threads open for the same question. Please delete your other post.
The easy choice is to add a date to the front of your time, then convert the whole to a timestamp.
Code: Select all
StringToTimestamp(DateToString(CurrentDate, "%yyyy-%mm-%dd") : " " : InLink.MyTime)
In this example I am assuming that your default timestamp format string is the usual default (YYYY-MM-DD HH24:MI:SS).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
saikiran
Premium Member
Posts: 18 Joined: Wed Aug 20, 2008 11:28 pm
Post
by saikiran » Wed Sep 17, 2008 10:31 pm
ray.wurlod wrote: It's not necessary to have multiple threads open for the same question. Please delete your other post.
The easy choice is to add a date to the front of your time, then convert the whole to a timestamp.
Code: Select all
StringToTimestamp(DateToString(CurrentDate, "%yyyy-%mm-%dd") : " " : InLink.MyTime)
In this example I am assuming that your default timestamp format string is the usual default (YYYY-MM-DD HH24:MI:SS).
Hello,
The format i/p format is hh:mi:ss and the datatype is varchar .....My output should be the same but the datatype should be timestamp
Thank you
Sai
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Wed Sep 17, 2008 11:07 pm
You can't have a timestamp without a date component. What date do you want to use for the date component?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.