Forum

General discussion on using the Kognitio Analytical Platform.
Contributor
Offline
User avatar
Posts: 386
Joined: Thu May 23, 2013 4:48 pm

How to handle an arithmetic overflow error

by markc » Mon Sep 01, 2014 4:22 pm

I've been seeing arithmetic overflow errors recently.

Sometimes with an imaging script I have which creates view images, and gives me "DS0100: Arithmetic overflow" or "RS0100: Arithmetic overflow", and sometimes with simple insert statements or select which can also give "CG0100: Arithmetic overflow".

How can I get to the bottom of the problem and resolve it?
Reply with quote Top
Contributor
Offline
User avatar
Posts: 386
Joined: Thu May 23, 2013 4:48 pm

Re: How to handle an arithmetic overflow error

by markc » Mon Sep 01, 2014 4:29 pm

In the case of your imaging script, the most likely problem is that you have some data which won't fit into the type allocated for it.

For instance, if you have a DECIMAL(9,2) field, and try to insert 1234567.8901, that will work.

If you now try to insert 12345678.901, that will fail as you can only have 7 digits before the decimal point, and you are trying to insert a value with 8 digits.

In this case, changing the type to DECIMAL(10,2) will allow the insert to work.

If you have dependent objects, they will need to be changed as well, of course.

To test, you can always find the minimum and maximum value you are trying to insert into each column, and try to cast those to the type of the column.

Finally, for integer types remember they are signed, so e.g. an INT1 (also known as TINYINT) is 1 byte, and can store values from -128 up to +127 (rather than 0 to 255 which an unsigned type would support).
Reply with quote Top

Who is online

Users browsing this forum: No registered users and 1 guest

cron