COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: mp3909 on 27 Jul 2021 05:13:26 AM

Title: BIGINT data size
Post by: mp3909 on 27 Jul 2021 05:13:26 AM
Hello,

What is the largest number the BIGINT data type is able to hold in Cognos report?

Thank You
Title: Re: BIGINT data size
Post by: dougp on 27 Jul 2021 03:35:05 PM
I don't think data types are defined in Cognos.  Do you mean, "What is the largest number the BIGINT data type is able to hold in SQL Server?" or something similar?

https://docs.microsoft.com/en-us/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql?view=sql-server-ver15
Title: Re: BIGINT data size
Post by: mp3909 on 17 Aug 2021 10:21:37 AM
Hi,

In my cognos report, one of the data items has a cast function defined within its data expression.
The actual number/value that gets stored in that data item comes directly from the SQL Server database.
But when I tried to run the report, it was giving an error saying "overflow".
So I changed the cast from an INT to BIGINT for that particular data item and that did the trick.
So I guess you can define data types in Cognos report, no?

Thanks,
Title: Re: BIGINT data size
Post by: dougp on 17 Aug 2021 03:34:52 PM
Quoteone of the data items has a cast function defined within its data expression
I don't understand.  Are you saying that there is a CAST built into the Framework Manager model?  Or are you saying that the data item expression in the report uses CAST?


QuoteThe actual number/value that gets stored in that data item
Cognos doesn't store data.  It reports data -- and hopefully the report design was thought out well enough that it's presenting information, not just data.


Quotecomes directly from the SQL Server database.
If the value comes directly from SQL Server, there is seldom a reason to use CAST.  What is the data type (in SQL Server)?  If it's a BIGINT, there is no reason to use CAST.  If it is INT, there should still be no reason to cast because there is no way a value stored as an INT in the database magically grows to something larger than an INT can handle without some external force being applied.
Are you sure you're not multiplying two numbers together or something?


Quoteit was giving an error saying "overflow"
I'm sure the error message was longer than "overflow".  Look at the details of the message to determine what actually went wrong.


Quoteyou can define data types in Cognos report
No.  You are not modifying the data.  But you can CAST the data to another type if that is what is needed to produce a valid join, concatenate a number to a string, or some other reporting need.