Informix Error Message
Posted in 2000
Topics: SQL Development & Query Writing
Hi, I am using Informix Dynamic Server 7.2. The database error -1226 "Decimal or money value exceeds maximum precision" is generated when an SQL query of the following type is executed: select sum(....) + sum(....) from table1, table2 where <join condition> and <column> between date1 and date2 The maximum value that could be calulated does NOT exceed the maximum precision. Furthermore, attempts to sum the data for say, January 1 thru January 16, succeed, but the sum for January 1 thru January 17 fails. The sum for January 17 succeeds. Could the table be corrupted? If anyone could help with this problem, I would be very grateful. Please email guinep@my-deja.com. Sent via Deja.com http://www.deja.com/ Before you buy.
I've seen this happen, but not on Online. When I got it, it was because I had a record in a money field that was stored something like 5.96e27, or 5.96 times 10 to the 27th power. The way I found it was I unloaded all the records for the day in question and scanned the file manually until I found the bad record. Then I updated it using it's primary key. In article <8f6puj$fe6$1@nnrp1.deja.com>, guinep@my-deja.com wrote: > Hi, > > I am using Informix Dynamic Server 7.2. The database error -1226 > "Decimal or money value exceeds maximum precision" is generated when an > SQL query of the following type is executed: > > select sum(....) + sum(....) > from table1, table2 > where <join condition> > and <column> between date1 and date2 > > The maximum value that could be calulated does NOT exceed the > maximum precision. Furthermore, attempts to sum the data for say, > January 1 thru January 16, succeed, but the sum for January 1 thru > January 17 fails. The sum for January 17 succeeds. > > Could the table be corrupted? > > If anyone could help with this problem, I would be very grateful. Please > email guinep@my-deja.com. > > Sent via Deja.com http://www.deja.com/ > Before you buy. > -- # unrm / ksh: unrm: not found # man cpio Sent via Deja.com http://www.deja.com/ Before you buy.
I recall a problem like this in either 7.1x or 7.2x. As far as I recall, it was a bug. In effect, if the resultant SUM exceeded the maximum value storeable in the base column by a factor of 10, the error was returned. As you can guess, we resolved the problem by increasing the size of the base column. You can try the same HTH Rudy guinep@my-deja.com wrote: > Hi, > > I am using Informix Dynamic Server 7.2. The database error -1226 > "Decimal or money value exceeds maximum precision" is generated when an > SQL query of the following type is executed: > > select sum(....) + sum(....) > from table1, table2 > where <join condition> > and <column> between date1 and date2 > > The maximum value that could be calulated does NOT exceed the > maximum precision. Furthermore, attempts to sum the data for say, > January 1 thru January 16, succeed, but the sum for January 1 thru > January 17 fails. The sum for January 17 succeeds. > > Could the table be corrupted? > > If anyone could help with this problem, I would be very grateful. Please > email guinep@my-deja.com. > > Sent via Deja.com http://www.deja.com/ > Before you buy.