SUM Function Precision in Informix 7.3
Posted in 2000
Topics: General Discussion
Hi, Anyone know how Informix handles the precision of two or more integers when using them with a SUM Function? ie. INTEGER(111111.11) INTEGER(111111.11) SUM = INTEGER(8,2) ? Is there a rule? Where is it documented? TIA, Dave (dhunt@filetek.com)
David Hunt wrote: > > Hi, > > Anyone know how Informix handles the precision of two or more integers when > using them with a SUM Function? > > ie. INTEGER(111111.11) > INTEGER(111111.11) > > SUM = INTEGER(8,2) ? > > Is there a rule? Where is it documented? Umm, integers have no decimal places! Informix convert all numeric types to DECIMAL for built-in aggregates with precision appropriate to the original operands (ie integer to DECIMAL(16,0), float to DECIMAL(16,2), etc.) then returns the result as that DECIMAL type. If your host variable is of another type (ie integer, short, float, double) a conversion takes place on transmission. Art S. Kagel