Error 1226 when using sum()? Dynamic Server broken or what?!
Posted in 1999
Topics: SQL Development & Query Writing
I have just run a test using ISQL that works fine on Informix SE but fails
miserably on Informix Dynamic Server. I have a table declared as follows:
create table mytest (value decimal(3,2));
I want to insert a whole lot of values and then select the sum of the
result. Well, it doesn't matter how much it adds up to in Informix SE,
everything works ok. But If the values add up to 100 or more in dynamic
server, I get error 1226 back! (1226 is "Decimal or or money value exceeds
maximum precision")
Example:
insert into mytest values (9.9);Run that 10 times and then run the following:
select sum(value) from mytest;
comes back with
(sum)
99.90
Perfect!
Now do one more insert
insert into mytest values (1);and run the select statement again:
select sum(value) from mytest;
The result?
"1226: Decimal or money value exceeds maximum precision."
That is, of course, ridiculous! I can't believe that the error hasn't been
encountered before - how can you survive without ever using sum? The
version we're using is 7.30.UC2-1; we only received it recently. Is there a
later version available?
Please, any help on this problem would be highly appreciated.
Carl
Thanks, but I just found the same problem mentioned in another thread:
"problem with sum() aggregate on IDS 7.30", so I'll follow up on that.
Incidently, does anyone know whether the problem is fixed in IDS 7.31?
Carl
Carl Reynolds wrote in message <7pt4v2$8r3$1@aklobs.kc.net.nz>...
>I have just run a test using ISQL that works fine on Informix SE but fails
>miserably on Informix Dynamic Server. I have a table declared as follows:
>
>create table mytest (value decimal(3,2));>
>I want to insert a whole lot of values and then select the sum of the
>result. Well, it doesn't matter how much it adds up to in Informix SE,
>everything works ok. But If the values add up to 100 or more in dynamic
>server, I get error 1226 back! (1226 is "Decimal or or money value exceeds
>maximum precision")
>
>Example:
> insert into mytest values (9.9);>Run that 10 times and then run the following:
> select sum(value) from mytest;
>comes back with
> (sum)
> 99.90
>
>Perfect!
>Now do one more insert
> insert into mytest values (1);>and run the select statement again:
> select sum(value) from mytest;
>The result?
> "1226: Decimal or money value exceeds maximum precision."
>
>That is, of course, ridiculous! I can't believe that the error hasn't been
>encountered before - how can you survive without ever using sum? The
>version we're using is 7.30.UC2-1; we only received it recently. Is there
a
>later version available?
>
>Please, any help on this problem would be highly appreciated.
>
>Carl
>
>
In article <7pt9df$9vc$1@aklobs.kc.net.nz>, Carl Reynolds
<carl@cjntech.co.nz> writes
>Thanks, but I just found the same problem mentioned in another thread:
>"problem with sum() aggregate on IDS 7.30", so I'll follow up on that.
>
>Incidently, does anyone know whether the problem is fixed in IDS 7.31?
>
Yes, we are running 7.30.UC5 on a customer site and it was have been
told it is fixed in 7.31.
>Carl
>
>Carl Reynolds wrote in message <7pt4v2$8r3$1@aklobs.kc.net.nz>...
>>I have just run a test using ISQL that works fine on Informix SE but fails
>>miserably on Informix Dynamic Server. I have a table declared as follows:
>>
>>create table mytest (value decimal(3,2));>>
>>I want to insert a whole lot of values and then select the sum of the
>>result. Well, it doesn't matter how much it adds up to in Informix SE,
>>everything works ok. But If the values add up to 100 or more in dynamic
>>server, I get error 1226 back! (1226 is "Decimal or or money value exceeds
>>maximum precision")
>>
>>Example:
>> insert into mytest values (9.9);>>Run that 10 times and then run the following:
>> select sum(value) from mytest;
>>comes back with
>> (sum)
>> 99.90
>>
>>Perfect!
>>Now do one more insert
>> insert into mytest values (1);>>and run the select statement again:
>> select sum(value) from mytest;
>>The result?
>> "1226: Decimal or money value exceeds maximum precision."
>>
>>That is, of course, ridiculous! I can't believe that the error hasn't been
>>encountered before - how can you survive without ever using sum? The
>>version we're using is 7.30.UC2-1; we only received it recently. Is there
>a
>>later version available?
>>
>>Please, any help on this problem would be highly appreciated.
>>
>>Carl
>>
>>
>
>
--
David Williams