/usr/share/doc/stilts/sun256/sec10.3.html is in stilts-doc 3.1.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="sun-style.css">
<title>Null Values</title>
</head>
<body>
<hr>
<a href="sec10.4.html">Next</a> <a href="jel-paramref.html">Previous</a> <a href="jel.html">Up</a> <a href="index.html">Contents</a> <br> <b>Next: </b><a href="sec10.4.html">Operators</a><br>
<b>Up: </b><a href="jel.html">Algebraic Expression Syntax</a><br>
<b>Previous: </b><a href="jel-paramref.html">Referencing Parameter Values</a><br>
<hr>
<h3><a name="sec10.3">10.3 Null Values</a></h3>
<p>When no special steps are taken, if a null value (blank cell)
is encountered
in evaluating an expression (usually because one of the columns
it relies on has a null value in the row in question) then the
result of the expression is also null.
</p>
<p>It is possible to exercise more control than this, but it
requires a little bit of care,
because the expressions work in terms of primitive values
(numeric or boolean ones) which don't in general have a defined null
value. The name "<code>null</code>"
in expressions gives you the java <code>null</code>
reference, but this cannot be matched against a primitive value
or used as the return value of a primitive expression.
</p>
<p>For most purposes, the following two tips should enable you to
work with null values:
<dl>
<dt><strong>Testing for null</strong></dt>
<dd>To test whether a column contains a null value, prepend the
string "<code>NULL_</code>"
(use upper case) to the column name or $ID. This
will yield a boolean value which is true if the column contains
a blank, and false otherwise.
</dd>
<dt><strong>Returning null</strong></dt>
<dd>To return a null value from a numeric expression, use the name
"<code>NULL</code>"
(upper case). To return a null value from a non-numeric expression
(e.g. a String column) use the name "<code>null</code>" (lower case).
</dd>
</dl>
</p>
<p>Null values are often used in conjunction with the conditional
operator, "<code>? :</code>"; the expression
<pre>
test ? tval : fval
</pre>
returns the value <code>tval</code> if the boolean expression <code>test</code>
evaluates true, or <code>fval</code> if <code>test</code> evaluates false.
So for instance the following expression:
<pre>
Vmag == -99 ? NULL : Vmag
</pre>
can be used to define a new column which has the same value as the
<code>Vmag</code> column for most values, but if <code>Vmag</code>
has the "magic" value -99 the new column will contain a blank.
The opposite trick (substituting a blank value with a magic one) can
be done like this:
<pre>
NULL_Vmag ? -99 : Vmag
</pre>
Some more examples are given in <a href="jelExamples.html">Section 10.6</a>.
</p>
<hr><a href="sec10.4.html">Next</a> <a href="jel-paramref.html">Previous</a> <a href="jel.html">Up</a> <a href="index.html">Contents</a> <br> <b>Next: </b><a href="sec10.4.html">Operators</a><br>
<b>Up: </b><a href="jel.html">Algebraic Expression Syntax</a><br>
<b>Previous: </b><a href="jel-paramref.html">Referencing Parameter Values</a><br>
<hr><i>STILTS - Starlink Tables Infrastructure Library Tool Set<br>Starlink User Note256<br>STILTS web page:
<a href="http://www.starlink.ac.uk/stilts/">http://www.starlink.ac.uk/stilts/</a><br>Author email:
<a href="mailto:m.b.taylor@bristol.ac.uk">m.b.taylor@bristol.ac.uk</a><br>Mailing list:
<a href="mailto:topcat-user@jiscmail.ac.uk">topcat-user@jiscmail.ac.uk</a><br></i></body>
</html>
|