[teiid-issues] [JBoss JIRA] (TEIID-2522) Let Extract(<Oracle Date field>) extract time components

Steven Hawkins (JIRA) jira-events at lists.jboss.org
Tue Jun 4 15:09:54 EDT 2013


     [ https://issues.jboss.org/browse/TEIID-2522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Hawkins updated TEIID-2522:
----------------------------------

    Fix Version/s: 8.5


The basic approach is to add logic similar to the string cast handling that will look for the native type of the column being extracted from and add an oracle cast to timestamp if it's a date.
                
> Let Extract(<Oracle Date field>) extract time components
> --------------------------------------------------------
>
>                 Key: TEIID-2522
>                 URL: https://issues.jboss.org/browse/TEIID-2522
>             Project: Teiid
>          Issue Type: Enhancement
>          Components: JDBC Connector
>            Reporter: Alex K.
>            Assignee: Steven Hawkins
>            Priority: Minor
>             Fix For: 8.5
>
>
> According to the Oracle's docs:
>  
> "The DATE datatype stores point-in-time values (dates and times) in a table. The DATE datatype stores the year (including the century), the month, the day, the hours, the minutes, and the seconds (after midnight)."
>  
> I expect to be able to extract the time parts from a date field, but when I am trying to extract the hour from an oracle's date field like:
>  
>  {code:sql}
> SELECT EXTRACT(HOUR FROM a.modifieddate) 
> FROM oracle_db.salestaxrate a 
> WHERE a.salestaxrateid = 1
>  {code}
>  
> and get a TEIID30504 exception.  When I look deeper in Teiid's log, i see the following Oracle's exception:
>  
> Caused by: java.sql.SQLException: Remote java.sql.SQLException: ORA-30076: invalid extract field for extract source
> That is an odd Oracle limitation - http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions052.htm
>  
> "If HOUR, MINUTE, or SECOND is requested, then expr must evaluate to an expression of datatype TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE, or INTERVAL DAY TO SECOND. DATE is not valid here, because Oracle Database treats it as ANSI DATE datatype, which has no time fields."
> *please enable extracting of time components from oracle's Date Fields* despite the Oracle's limitation 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the teiid-issues mailing list