NSDecimalNumberExactnessException
"Les Harvey" <[email protected]> Fri, 7 Mar 2003 09:04:05 -0000
| Newsgroups | gmane.comp.web.webobjects.devel,gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <[email protected]> |
Hi, I am porting a Java WO application in WO 4.5.1 Update4 to use Oracle 8.1.6. The original application used Sybase and consists of countless EOUtilites.rawRowsForSQL calls. However, during the port to Oracle I now encounter the following exception NSDecimalNumberExactnessException: OracleNumberColumn encountered loss of precision; when I attempt to use division in raw SQL. The offending SQL is of the form: "SELECT (sum(colA) - sum(colB))/sum(colC)/count (distinct colD) FROM ..." The complete SQL evalutes OK when executed within SQPLPlus !! Converting the sum(colC) to an integer using FLOOR or CEIL causes the problem to disappear. The attributes colA, colB and colC are declared as NUMBER in Oracle, so should handle floating point stuff. I have tried using Double and DecimalNumber in the Attribute Inspector within EOModeller, these map to Value Class'es (Number and BigDecimal) respectively. Anyone else seen this problem? Cheers Les Les Harvey "Perfection (in design) is achieved not when there is nothing more to add, but rather when there is nothing more to take away" - Antoine de Saint-Exupery