You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@trafodion.apache.org by "Liu, Ming (Ming)" <mi...@esgyn.cn> on 2016/03/17 04:51:07 UTC

Trafodion support of TO_DATE

Hi, all,

I know there will be a new feature to support TO_DATE, currently, without this feature, is there any way to migrate a query using TO_DATE?

Example:
insert into myTbl (staff_id, orbat_code,operate_time,ip_arr,browser_version,orbat_desc) values('ADMIN','V1369930001010',to_date('20160317114706','yyyy-MM-dd hh24:mi:ss')


thanks,
Ming

答复: Trafodion support of TO_DATE

Posted by "Liu, Ming (Ming)" <mi...@esgyn.cn>.
Thanks Anoop,

I see how to change it now.
This will be some work to replace all literal in the application, so the coming TO_DATE feature of Trafodion 2.0 will be a great help for database migration project.

Thanks,
Ming

发件人: Anoop Sharma [mailto:anoop.sharma@esgyn.com]
发送时间: 2016年3月17日 12:05
收件人: user@trafodion.incubator.apache.org
主题: RE: Trafodion support of TO_DATE


You will have to convert the TO_DATE part of the query to an explicit datetime literal that looks like:
   timestamp ‘2016-03-17 11:47:06’

With TO_DATE support (this is on trafodion now but will be externally available as part of Traf 2.0), you
can use the statement that you have listed.
But…the format part need to match the string datetime value. In your example, it doesn’t.
The correct syntax will be:
  to_date(‘20160317114706’, ‘YYYYMMDDHH24MISS’)

or

  to_date(‘2016-03-17 11:47:06’, ‘YYYY-MM-DD HH24:MI:SS’)

anoop

From: Liu, Ming (Ming) [mailto:ming.liu@esgyn.cn]
Sent: Wednesday, March 16, 2016 8:51 PM
To: user@trafodion.incubator.apache.org<ma...@trafodion.incubator.apache.org>
Subject: Trafodion support of TO_DATE

Hi, all,

I know there will be a new feature to support TO_DATE, currently, without this feature, is there any way to migrate a query using TO_DATE?

Example:
insert into myTbl (staff_id, orbat_code,operate_time,ip_arr,browser_version,orbat_desc) values('ADMIN','V1369930001010',to_date('20160317114706','yyyy-MM-dd hh24:mi:ss')


thanks,
Ming

RE: Trafodion support of TO_DATE

Posted by Anoop Sharma <an...@esgyn.com>.
 

You will have to convert the TO_DATE part of the query to an explicit
datetime literal that looks like:

   timestamp '2016-03-17 11:47:06'

 

With TO_DATE support (this is on trafodion now but will be externally
available as part of Traf 2.0), you

can use the statement that you have listed.

But.the format part need to match the string datetime value. In your
example, it doesn't.

The correct syntax will be:

  to_date('20160317114706', 'YYYYMMDDHH24MISS')

 

or

 

  to_date('2016-03-17 11:47:06', 'YYYY-MM-DD HH24:MI:SS')

 

anoop

 

From: Liu, Ming (Ming) [mailto:ming.liu@esgyn.cn] 
Sent: Wednesday, March 16, 2016 8:51 PM
To: user@trafodion.incubator.apache.org
Subject: Trafodion support of TO_DATE

 

Hi, all,

 

I know there will be a new feature to support TO_DATE, currently, without
this feature, is there any way to migrate a query using TO_DATE?

 

Example:

insert into myTbl (staff_id,
orbat_code,operate_time,ip_arr,browser_version,orbat_desc)
values('ADMIN','V1369930001010',to_date('20160317114706','yyyy-MM-dd
hh24:mi:ss')  

 

 

thanks,

Ming