Hello:
I get an external file that has "Record Date" as MM/DD/YYYY HH24:MM (11/19/2009 18:24) format.. The rows abort trying to load into oracle table due to the date/time format. In oracle that 'Record Date' is defined as Timestamp (YYYY-MM-DD HH24:MI:SS). Upon using search functionality here, I used Iconv/Oconv functions without any luck... I am home and cannot paste what I am doing...
Any pointers or code to help me convert the input column from "MM/DD/YYYY HH24:MI" to Oracle's "YYYY-MM-DD HH24:MI:SS" format is highly appreciated.
Thank You,
-Sam
Converting date to Timestamp !!
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
For the date portion
For the time portion
Concatenate these with a space between.
Code: Select all
Oconv(Iconv(Left(InLink.Fieldname,10),"DMDY"),
"D-YMD[4,2,2]")
Code: Select all
Oconv(Iconv(Right(InLink.Fieldname, 5), "MT"),"MTS")
Code: Select all
Oconv(Iconv(Left(InLink.Fieldname,10),"DMDY"), "D-YMD[4,2,2]") : " " : Oconv(Iconv(Right(InLink.Fieldname, 5), "MT"),"MTS")
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.