[
https://issues.apache.org/jira/browse/TRAFODION-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yuan Liu updated TRAFODION-2619:
--------------------------------
Description:
We can convert '2017-01-01' and '2017/01/01' to date, and we can convert
'2017-01-01 00:00:00' to timestamp, but we can not convert '2017/01/01
00:00:00' to timestamp, can we have such enhancement. Or can we have
to_date('2017/01/01 00:00:00','YYYY/MM/DD HH24:MI:SS')?
>>select to_date('2017/01/01','YYYY/MM/DD') from dual;
(EXPR)
----------
2017-01-01
--- 1 row(s) selected.
>>select to_date('2017-01-01','YYYY-MM-DD') from dual;
(EXPR)
----------
2017-01-01
--- 1 row(s) selected.
>>select to_timestamp('2017/01/01 00:00:00') from dual;
*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot
be converted. Source data: 2017/01/01 00:00:00
--- 0 row(s) selected.
>>
>>
>>
>>select to_timestamp('2017-01-01 00:00:00') from dual;
(EXPR)
--------------------------
2017-01-01 00:00:00.000000
--- 1 row(s) selected.
was:
We can convert '2017-01-01' and '2017/01/01' to date, and we can convert
'2017-01-01 00:00:00' to timestamp, but we can not convert '2017/01/01
00:00:00' to timestamp, can we have such enhancement.
>>select to_date('2017/01/01','YYYY/MM/DD') from dual;
(EXPR)
----------
2017-01-01
--- 1 row(s) selected.
>>select to_date('2017-01-01','YYYY-MM-DD') from dual;
(EXPR)
----------
2017-01-01
--- 1 row(s) selected.
>>select to_timestamp('2017/01/01 00:00:00') from dual;
*** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot
be converted. Source data: 2017/01/01 00:00:00
--- 0 row(s) selected.
>>
>>
>>
>>select to_timestamp('2017-01-01 00:00:00') from dual;
(EXPR)
--------------------------
2017-01-01 00:00:00.000000
--- 1 row(s) selected.
> to_timestamp('2017/01/01 00:00:00') fail to convert
> ---------------------------------------------------
>
> Key: TRAFODION-2619
> URL: https://issues.apache.org/jira/browse/TRAFODION-2619
> Project: Apache Trafodion
> Issue Type: Improvement
> Components: sql-exe
> Affects Versions: any, 2.2-incubating
> Reporter: Yuan Liu
> Fix For: any
>
>
> We can convert '2017-01-01' and '2017/01/01' to date, and we can convert
> '2017-01-01 00:00:00' to timestamp, but we can not convert '2017/01/01
> 00:00:00' to timestamp, can we have such enhancement. Or can we have
> to_date('2017/01/01 00:00:00','YYYY/MM/DD HH24:MI:SS')?
> >>select to_date('2017/01/01','YYYY/MM/DD') from dual;
> (EXPR)
> ----------
> 2017-01-01
> --- 1 row(s) selected.
> >>select to_date('2017-01-01','YYYY-MM-DD') from dual;
> (EXPR)
> ----------
> 2017-01-01
> --- 1 row(s) selected.
> >>select to_timestamp('2017/01/01 00:00:00') from dual;
> *** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not valid and cannot
> be converted. Source data: 2017/01/01 00:00:00
> --- 0 row(s) selected.
> >>
> >>
> >>
> >>select to_timestamp('2017-01-01 00:00:00') from dual;
> (EXPR)
> --------------------------
> 2017-01-01 00:00:00.000000
> --- 1 row(s) selected.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)