COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: RubenvdLinden on 01 Dec 2014 11:13:06 AM

Title: Casting integer to interval (minute) no longer works
Post by: RubenvdLinden on 01 Dec 2014 11:13:06 AM
I had a report in Cognos 10.1.1 in which I cast an integer value to interval, e.g.:

cast(960; interval minute)

(960 can be replaced by an integer dataitem).

In Cognos 10.2.1 fixpack 5, this no longer works:
UDA-EE-0107 Casting an numeric value to an interval with a non-single primary datefield is invalid.


I might be able to fix this with:
960 * 1 minute

but I'm wondering why the cast is no longer supported?
Title: Re: Casting integer to interval (minute) no longer works
Post by: MFGF on 01 Dec 2014 11:41:32 AM
Quote from: RubenvdLinden on 01 Dec 2014 11:13:06 AM
I had a report in Cognos 10.1.1 in which I cast an integer value to interval, e.g.:

cast(960; interval minute)

(960 can be replaced by an integer dataitem).

In Cognos 10.2.1 fixpack 5, this no longer works:
UDA-EE-0107 Casting an numeric value to an interval with a non-single primary datefield is invalid.


I might be able to fix this with:
960 * 1 minute

but I'm wondering why the cast is no longer supported?

I'm not aware of any change in the way this works. Are you sure the item is still an integer? If I would you I would:

a. Check the data type of the item in your database.
b. Check the data type of the item in your FM model.

If I was a betting man, I'd wager the data type in the FM model might have changed from Integer to something different - perhaps when the xml was upgraded? Just a guess, though.

Cheers!

MF.
Title: Re: Casting integer to interval (minute) no longer works
Post by: RubenvdLinden on 01 Dec 2014 12:44:16 PM
Yes, it worked fine until the upgrade to 10.2.1 this weekend  ;D
I also tried casting the dataitem to smallint first, then cast it to interval. Same result.

To make sure, I also tried packages on multiple database platforms (both Oracle and MSSQL). No difference.