Shalma
Shalma

Reputation: 153

How to split datetime into date and time in informatica

I am using Informatica 8.1.1. Source flat file contains one date/time field. I want to load it as two separate columns date and time in target table. I tried TO_DATE function to get the date and time separately. But it is giving some errors.

How can I split this date/time into date and time? or Can we load a string value from source flat file into a date value in target table?

Upvotes: 0

Views: 18536

Answers (3)

john
john

Reputation: 11

No need to split. just connect date and time column with the same port.

Upvotes: 1

jagan
jagan

Reputation: 21

You could use the following to load the flat file:

For the date field:

to_char(get_date_part(in_date,'YYYY'))||to_cha r(get_date_part(in_date,'MM'))||to_char(get_date_pa rt(in_date,'DD')) 

For the time field:

to_char(get_date_part(in_date,'HH24'))||to_cha r(get_date_part(in_date,'MI'))||to_char(get_date_pa rt(in_date,'SS'))

Upvotes: 2

user350911
user350911

Reputation: 1

Read the help section on the GETDATEPART function

Upvotes: -2

Related Questions