简体   繁体   English

informatica 日期时间数据类型格式

[英]informatica datetime datatype format

I want to convert the string 20160101000000 into datetime format using expression.我想使用表达式将字符串 20160101000000 转换为日期时间格式。 I have used below date function我使用了以下日期函数

 TO_DATE(PERIOD_END_DATE),'MM/DD/YYYY HH24:MI:SS')

But my table file is not loading.但是我的表文件没有加载。 My session and workflow gets succeed.我的会话和工作流程成功了。 My target and source is also flatfile.我的目标和源也是平面文件。

I want to change the string 20160101000000 into MM/DD/YYYY HH24:MI:SS for loading data into my target table.我想将字符串20160101000000更改为MM/DD/YYYY HH24:MI:SS以将数据加载到我的目标表中。

You need to give exact format that looks so that to_date function can understand that format and converts it into date.您需要提供看起来的确切格式,以便 to_date 函数可以理解该格式并将其转换为日期。

 TO_DATE(PERIOD_END_DATE,'YYYYMMDDHH24MISS')

So here your date looks like YYYYMMDDHH24MISS (20160101000000).所以在这里你的日期看起来像 YYYYMMDDHH24MISS (20160101000000)。

There is often confusion with the TO_DATE function... it is in fact for converting a string into a date and the function itself is to describe the pattern of the incoming date. TO_DATE 函数经常被混淆……它实际上用于将字符串转换为日期,而函数本身是描述传入日期的模式。 Now if you want to convert a date field to a specified date format you must use TO_CHAR现在,如果要将日期字段转换为指定的日期格式,则必须使用 TO_CHAR

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

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