Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Condition for generating NULL - forum topic by eliot

$
0
0

Hi,
I'm wondering when will NULL value being generated.
Given the following query:
        SELECT CASE WHEN (ACOS(2.3) IS NULL) THEN 'T' ELSE 'F' END AS C0
I'm expecting 'T', because '2.3' is out of value range for ACOS(), thus ACOS(2.3) should be 'NULL'. However 'F' is returned actually.
Teradata will complain the following query as 'Invalid Input: numeric value within range only.':
        SELECT ACOS(2.3) AS C0
The points I don't understand are:
(1) Why the first query won't complain about the invalid argument?
(2) Suppose the invalid argument check will happen on the fly, then ACOS(2.3) should be 'NULL', but since the first query return 'F', it indicates ACOS(2.3) is valid. Is this by design?
Thanks!
Eliot

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>