IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

ESQL NULL data type

All ESQL data types (except REFERENCE) support the concept of the null value. A value of null means that the value is unknown, undefined, or uninitialized. Null values can arise when you refer to message fields that do not exist, access database columns for which no data has been supplied, or use the keyword NULL, which supplies a null literal value.

Null is a distinct state and is not the same as any other value. In particular, for integers it is not the same thing as the value 0 and for character variables it is not the same thing as a string of zero characters. The rules of ESQL arithmetic take null values into account, and you are typically unaware of their existence. Generally, but not always, these rules mean that, if any operand is null, the result is null.

If an expression returns a null value its data type is not, in general, known. All null values, whatever their origin, are therefore treated equally.

This can be regarded as their belonging to the data type NULL , which is a data type that can have just one value, null.

An expression always returns NULL if any of its elements are NULL.

Testing for null values

To test whether a field contains a null value, use the IS operator described in Operator=.

The effect of setting a field to NULL

Take care when assigning a null value to a field. For example, the following command deletes the Name field:
 SET OutputRoot.XMLNS.Msg.Data.Name = NULL;  -- this deletes the field
The correct way to assign a null value to a field is as follows:
SET OutputRoot.XMLNS.Msg.Data.Name VALUE = NULL;  
-- this assigns a NULL value to a field without deleting it

ac05960_.htm | Last updated Friday, 21 July 2017