SQL database system
 
Manual page for null(TDH)

NULL handling

In shsql statements and results, NULL represents a field that is empty, blank, or has no value.


NULL in SQL statements

NULL may be specified in upper or lower case.

In where clauses, it may appear on the right-hand side of equality comparisons using any of the constructs shown below:

X = null             X is null

X != null             X isnot null             X <> null

NULL may also appear as a member of a list for operations such as IN:

X in "A,B,C,null"


NULL in result rows

shsql(1) represents NULL fields as null by default. When using the API, NULL fields are represented in returned result rows using the internal code discussed below, which is equals-sign (=) by default. The calling program can convert these fields as desired.


Internal representation of NULL

In data files NULL is stored using a certain code. By default this code is a single equals sign (=), but this can be set in your project config file to be any symbol up to 4 characters in length. Your NULL symbol should not cooincide with something that could occur as a meaningful non-null field in your data.

A data record containing three null fields, using the default null symbol, would look like this in the data table file:

28 Phoenix = = =


Copyright Steve Grubb  


Markup created by unroff 1.0,    March 18, 2004.