Page 1 of 1

How to Convert from DD-MM-YYYY hh24:mi:ss to YYYY-MM-DD hh24

Posted: Tue May 01, 2007 12:49 am
by moose2079
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

Posted: Tue May 01, 2007 3:40 am
by ray.wurlod
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.

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"

Re: How to Convert from DD-MM-YYYY hh24:mi:ss to YYYY-MM-DD

Posted: Wed May 16, 2007 12:23 am
by baglasumit21
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
I think a better option is to use sub-string and rearrange the date.