SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
N-10
Null Values and Expression Evaluation
Null Values and Expression Evaluation
This chart summarizes the results of expression evaluation with null values.
NULL_DISPLAY Option
NULL_DISPLAY is an option of the SQLCI report writer SET STYLE command that
defines a character to represent NULL print items in a report.
character
is a printable, single-byte character used to represent the null value in a printed
report. The default is ? (question mark).
Example—NULL_DISPLAY
This example adds a column with null values and prints the column twice, using a
different value for the NULL_DISPLAY option each time:
>> ALTER TABLE PRJ ADD COLUMN DEPT PIC X(6) DEFAULT NULL;
--- SQL operation complete.
>> SELECT DEPT FROM PRJ;
DEPT
------
?
?
?
--- 3 row(s) selected.
>> SET STYLE NULL_DISPLAY "Z";
Expression Type Condition Result
Boolean (AND, OR, NOT) Either value null True, false, or null
See truth tables in Search
Conditions on page S-5
Arithmetic
Either or both
values null
Null
NULL predicate See SEARCH CONDITION
Aggregate functions
(except COUNT)
Evaluated after
eliminating nulls
Null if set is empty
COUNT
COUNT DISTINCT
Evaluated after
eliminating nulls
Zero if set is empty
Comparison:
> < = >=
<= <> LIKE
Either value null Null
IN predicate Expression is null Null
Subquery No values returned Null
NULL_DISPLAY "character"