NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
N-9
Specifying Null Values in Host Programs
The following example invokes a table description in SQL format (the default
format through SQLCI). The display shows NOT NULL for columns whose
definition prohibits null values.
>> INVOKE OD2;
-- Definition of table \SYS1.$VOL1.SALES.OD2
-- Definition current at 16:36:57 - 05/23/89
(
ORDERITEM DECIMAL( 6, 0 ) UNSIGNED NO DEFAULT
NOT NULL
, ORDERNUM NUMERIC( 6, 0 ) UNSIGNED NO DEFAULT
NOT NULL
, ORDER_DATE NUMERIC( 6, 0 ) NO DEFAULT
, DELIV_DATE NUMERIC( 6, 0 ) NO DEFAULT
, SALES_REP DECIMAL( 4, 0 ) UNSIGNED DEFAULT SYSTEM
, CUSTNUM DECIMAL( 4, 0 ) UNSIGNED NO DEFAULT
)
Specifying Null Values in Host Programs
Host programs use indicator variables to indicate the presence of null values. See
Indicator Variables and Indicator Parameters on page I-11 or the NonStop SQL
programming manual for your host language for more information.
DISTINCT, GROUP BY, and ORDER BY With Null Values
In evaluating the DISTINCT, GROUP BY, and ORDER BY clauses, SQL considers all
null values to be equal. Additional considerations for these clauses are:
DISTINCT Null values are considered duplicates; a result has at most one null
GROUP BY The result has at most one null group
ORDER BY Null values are considered greater than non-null values