CURSA supports null values in catalogues. Null values are used to represent a field for which no actual value is available. Null values can arise in several ways. They may be present in a catalogue when it is read by CURSA. An example might be a catalogue of multi-colour photometry for a set of stars where measures for some colours were missing for some of the stars. Null values would be used to represent the missing values. Alternatively, they might arise where an expression is being used to compute a new column and evaluation of the expression for the current row results in a ‘ by zero’ error. No valid value will be available for the expression, so a null value will be substituted.
Throughout CURSA null values have the single, simple meaning that ‘no value is available for this datum’. It is possible to invent schemes where a set of null values are supported, each with a subtly different gradation of meaning. However, CURSA does not support such schemes.
You do not need to know all the details of how CURSA manipulates null values internally. However, the following points may be useful.
x + y
’ then the result would be null if either x
or y
(or both) were null. The generation of a null in this fashion is not considered an error and
no message or warning is reported.
x > 2.0
’ then rows where x
is null would not satisfy the
expression.
NULL
is available to determine whether a field is null or not. For example, to
select the rows for which column x
is not null the following expression would be used:
‘.NOT. NULL(x)
’.
When null values are displayed by xcatview
(see Section 11) or catview
(see Section 12) they will
normally be represented by the string ‘<null>
’. However, if there is insufficient space to display them
in this way they will be represented by the single character ‘?
’.