Hi Eliot,
ACOS will return NULL only for NULL as input value, but when the value is out of the valid range there should be a 5585 error.
So this seems to be a bug, the optimizer doesn't actually evaluate the expression, but assumes that it will return a value (which is NOT NULL).
The get a NULL you should check if the input value is within the allowed range, e.g.
CASE WHEN x BETWEEN -1 AND 1 THEN ACOS(x) END
Hi Eliot,
ACOS will return NULL only for NULL as input value, but when the value is out of the valid range there should be a 5585 error.
So this seems to be a bug, the optimizer doesn't actually evaluate the expression, but assumes that it will return a value (which is NOT NULL).
The get a NULL you should check if the input value is within the allowed range, e.g.
CASE WHEN x BETWEEN -1 AND 1 THEN ACOS(x) END
Dieter