简体   繁体   English

Informatica日期/时间转换

[英]Informatica Date/Time Conversion

in one of the requirment informatica fetching data from flat file as source file and insert records into a temporary table temp of DB2 database. 在其中一个需求信息中,从平面文件中获取数据作为源文件,并将记录插入到DB2数据库的临时表temp中。 Flat file has one column as datetime datatype (YYYY/MM/DD HH:MM:SS). 平面文件有一列作为datetime数据类型(YYYY / MM / DD HH:MM:SS)。 However, informatica fetching this column as string datatype (Since Informatica date format is different from this column & DB2). 但是,informatica将此列作为字符串数据类型获取(因为Informatica日期格式与此列和DB2不同)。 So before loading into temp table of DB2 database, I need to convert back this column into Datetime format. 因此,在加载到DB2数据库的临时表之前,我需要将该列转换回Datetime格式。

With Expresion transformation, I can do this but I dont know how? 通过Expresion转换,我可以做到这一点,但我不知道怎么做? To_date conversion function ( TO_DATE(FIELD, 'YYYY/MM/DD HH:MM:SS') ) is there but it will take care of date only (YYYY/MM/DD). To_date转换函数( TO_DATE(FIELD, 'YYYY/MM/DD HH:MM:SS') )在那里,但它只会处理日期(YYYY / MM / DD)。 Its not taking care of time (HH:MM:SS) and because of this records are not inserting into temp table. 它不占用时间(HH:MM:SS),并且由于该记录未插入到临时表中。

How can I convert datetime from String datatype to DB2 datetime format (YYYY/MM/DD HH:MM:SS)? 如何将datetime从String数据类型转换为DB2 datetime格式(YYYY / MM / DD HH:MM:SS)?

You tried to use the month format string (ie MM ) for the minutes part of the date. 您试图在日期的分钟部分中使用月份格式字符串(即MM )。

You need to use MI : 你需要使用MI

TO_DATE(FIELD, 'YYYY/MM/DD HH:MI:SS')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM