Page 1 of 1

Converting VarChar into Oracle Timestamp (Date)

Posted: Wed Mar 18, 2015 10:24 am
by Childrensmn
I have "NewDate" column coming from SQL Server as VarChar with the following format:
MM/DD/YYYY HH:MI
6/14/2014 16:07

I want to load this into Oracle table using Timestamp datatype (Its Date in Oracle).

Any pointers/help is appreciated.

Thanks!!

Posted: Wed Mar 18, 2015 10:41 am
by AshishDevassy
If its 'MM'/DD/YYY HH:MI shouldn't the data be 06.14.2014 16:07 ?

Posted: Wed Mar 18, 2015 10:55 am
by Childrensmn
Here is how the data for that column is
6/14/2014 16:07
and
I want to load it in Oracle as Timestamp (Date) 'YYYY-MM-DD HH24:MI:SS'

Posted: Wed Mar 18, 2015 12:32 pm
by AshishDevassy
alright.
Here's what you can try.
Read the data as varchar. Use transformer to extract the data before the ' ' and then use type conversion function to change it to date.

Posted: Wed Mar 18, 2015 3:11 pm
by ray.wurlod
Research format strings, in particular how to accommodate elements that have a variable number of characters (for example your month and day components may have one or two digits).

Posted: Thu Mar 19, 2015 7:23 am
by taylor.hermann
I'd try researching the StringToTimestamp function available. It sounds like it may fit your needs