COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Topic started by: blom0344 on 10 May 2007 10:14:10 AM

Title: Not able to parse year conversion of Oracle dates
Post by: blom0344 on 10 May 2007 10:14:10 AM
For a typical Framework the connection can only be Oracle. So, for adding dimensions like year I am trying to define new objects that hold the year part of a date , like:

to_number(to_char(datefield,'YYYY'))

However, this gives typical error messages like :


GEN-ERR-0015 Initially, in data source type(s) 'OL', function 'fn:to_char' is not supported in 'RelationalQueryProvider'. After decomposition, in data source type(s) 'OL', function 'fn:to_char' is not supported in 'RelationalQueryProvider'.


Anyone any idea what is wrong? What does OL mean any way?

Thanx..
Title: Re: Not able to parse year conversion of Oracle dates
Post by: COGNOiSe administrator on 10 May 2007 07:24:47 PM
Can't you just use year(datefield) ?
Title: Re: Not able to parse year conversion of Oracle dates
Post by: blom0344 on 11 May 2007 02:07:21 AM
Yes, that seems to parse. Which leads to the question why it is not listed in the function oversight.
Is there a known issue with using native database functions within the framework?
Title: Re: Not able to parse year conversion of Oracle dates
Post by: blom0344 on 11 May 2007 04:54:34 AM
A quick check in the cognos Knowledge base pointed to the connection type. When you change the type from 'OL' to 'OR' native functions are working as they should. This seems to be only possible within the Framework itself.
Title: Re: Not able to parse year conversion of Oracle dates
Post by: COGNOiSe administrator on 11 May 2007 09:28:04 AM
Meesa wonder if OL stands for ORACLE OLEDB ...

Anyhow, if there is a native function missing, you can always add it.
Title: Re: Not able to parse year conversion of Oracle dates
Post by: blom0344 on 11 May 2007 10:45:51 AM
jA-jA, You are right about the OLEDB..
Title: Re: Not able to parse year conversion of Oracle dates
Post by: MDXpressor on 30 May 2007 11:48:26 PM
Isn't the Oracle function called Extract?

Extract(year,[datefield])
Title: Re: Not able to parse year conversion of Oracle dates
Post by: blom0344 on 31 May 2007 01:28:16 AM
Yep, but in that case it is

Extract(Year from [datefield])

In my case my reference-point is still Oracle 7 (cause I'm really a DB2 guy), and I have to catch up with Oracle9 and 10 enhancements.

Interestingly, Oracle8i does not document the  Extract function, but it seems to work okay in 8.1.7.

Thanks for the tip anyway..