I have a source Varchar(38) field in a sequential file that I want to load to an Oracle DataBase target column (using a Bulk Loader) - the target field is a TimeStamp
How do I Convert from DD-MM-YYYY hh24:mi:ss to YYYY-MM-DD hh24 Using oConv(iConv ???? Please advise
Michael Mills
How to Convert from DD-MM-YYYY hh24:mi:ss to YYYY-MM-DD hh24
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Because there are no internal data types in server jobs, you could simply re-arrange the substrings.
Otherwise, you need to convert the date and time portions separately and concatenate them with a separating space character. Because it's Oracle, I suspect you'll need minutes and seconds too - if not, leave out the ":00:00" string.
Otherwise, you need to convert the date and time portions separately and concatenate them with a separating space character. Because it's Oracle, I suspect you'll need minutes and seconds too - if not, leave out the ":00:00" string.
Code: Select all
Oconv(Iconv(Field(InLink.TheTimestamp," ",1,1),"DDMY"),"D-YMD[4,2,2]") : " " : Left(Field(InLink.TheTimestamp," ",2,1),2) : ":00:00"
Last edited by ray.wurlod on Wed May 16, 2007 12:48 am, edited 1 time in total.
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.
-
- Participant
- Posts: 132
- Joined: Wed Mar 01, 2006 11:12 pm
- Location: Pune
Re: How to Convert from DD-MM-YYYY hh24:mi:ss to YYYY-MM-DD
I think a better option is to use sub-string and rearrange the date.moose2079 wrote:I have a source Varchar(38) field in a sequential file that I want to load to an Oracle DataBase target column (using a Bulk Loader) - the target field is a TimeStamp
How do I Convert from DD-MM-YYYY hh24:mi:ss to YYYY-MM-DD hh24 Using oConv(iConv ???? Please advise
Michael Mills
SMB