Sometimes the Warning helps me find a Problem when I use SUM or AVG and the existence of null values can lead to a wrong/unexpected result. I have traced a not working Query in my app down to this. Test Case
In iSql I get the expected Result 2 which is fine. With a request level logging in the Database if find the following Warning which i don't get to see in iSql but broke my Query over ODBC.
This is for me unexpected because the documentation for COUNT function I can read Return the number of rows in each group where the value of expression is not NULL So it is expected that With ansinull set to On, the evaluation of any aggregate function, except Is there a switch that I can get these errors/warnings in iSQL ? When I debug a Query i would like to see these warnings. I have checked I use 16.0.0 Build 2234. Thomas |
Interestingly, when leaving out the first SELECT statement, dbisqlc does return the warning whereas DBISQL does not (I'm using 12.0.1.4314 with ansinull set to the default "On"). - No, I don't have a clue.
The fact that COUNT(AnyExpression) does raise a warning when "ansinull" is set to "On" is expected behaviour, methinks.