简体   繁体   中英

Required get_date oracle sql function replacement in informatica expression transformation

I executed below query in oracle sql developer. create_date is number field in oracle.

select create_date,get_date(create_date) from test;

Output:

CREATE_DATE GET_DATE(CREATE_DATE)
801172716   5/22/1995 19:58:36

In informatica expression transformation i tried many functions to convert that decimal to date.But i am not able to get the required date.

Can someone tell me which expression should be used in informatica expression transformation.

Your create_date numeric value represents a Unix Timestamp value. You can use numtodsinterval function as

select to_timestamp('1970-01-01','yyyy-mm-dd hh24:mi:ss') 
       + numtodsinterval(create_date,'second') as get_datetime
  from test

to get the desired value. If you need only the date part, then use :

select 
      cast(
       to_timestamp('1970-01-01','yyyy-mm-dd hh24:mi:ss') 
       + numtodsinterval(create_date,'second')
       as date
       ) as get_date
  from test

Demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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