Question

I am in the process of upgrading a few in-house applications from ADS 7.1 to 8.1.

I was told a while back that there are changes in return values of the AVG() function as well as some division calculations, but I cannot find any documentation on these changes.

Does anyone know what I'm talking about or have a link that explains the details?

Was it helpful?

Solution

The "Effects of Upgrading to Version 8.1" topic in the help file has a small paragraph about the change, but doesn't go into any details.

Basically, as of version 8.1 Advantage now adheres to the SQL standard with regards to integer division. Integer division expressions have the fractional portion truncated, where in the past they would result in a floating point result.

To address this change, you may have to cast certain expressions if you still want them to result in a floating point data type. For example:

This:

select int1 / int2 from mytable;

Would need to change to:

select cast( int1 as sql_float ) / int2 from mytable;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top