DML: handling null and absent values

Null and absent values

When the Map Engine server encounters null and absent

How the Map Engine server manages null and absent

Null and absent values

The values null and absent are constants that the Map Engine server can encounter when it executes an integration task.

When the Map Engine server encounters "null" and "absent"

Null and absent occur in different situations, depending on when the Map Engine encounters them.

null

For each Business Document structure type, the following table summarizes when the value null occurs.

Structure type "null" occurs when...

XML

A tag is present but has no value.

This occurs when:

  • An end tag has no corresponding start tag.
  • Example: <node/>)
  • A tag is empty and the data class of the corresponding Business Document node is Boolean, Date & Time, Integer, or Real number.
  • Example: <node></node>)

Fixed position/length, Fixed and Variable segment

A field contains only padding characters.

Variable

Two separators occur together (semi-colons, for example ;; ).

Database

A field contains the value null.

absent

For each Business Document structure type, the following table summarizes when the value absent occurs.

Structure Type absent occurs when

XML

No tag is present

Fixed position/length, Fixed segment

(not applicable)

Fixed position/length, Variable segment

The last fields do not contain data

Variable

A separator signals that a field exits but the field is missing.

Example: data;;

Here:

  • The first field contains the value data.
  • The second field contains the value null.
  • The third field contains the value absent.

Database

The value absent cannot occur in a table or a view.

How the Map Engine server manages "null" and "absent"

The software includes a set of rules that manage the values null and absent when they are encountered:

Arithmetic operators

When the value null or absent forms part of an arithmetic operation, the operation returns the value null. However, the operation null/0 returns an error.

Comparison operators

When the value null or absent forms part of a comparison operation, the operation returns the value null.

Boolean operators: and, or, xor, not

Unlike the values true and false, the values null and absent are not communicative in expressions that:

  • Combine the return values of two Boolean expressions via the reserved words and, or, and xor.
  • Convert the return value of a Boolean expression via the reserved word not.

The order in which these values appear determines the value that the expression returns.

The following table summarizes how the software works with the and operator. Note that the software does not treat the following expressions in the same way:

  • true and null/absent
  • false and null/absent
and true false null absent

true

true

false

null

null

false

false

false

false

false

null

null

null

null

null

absent

null

null

null

null

The following table summarizes how the software works with the or operator. Note that the software does not treat the following expressions in the same way.

  • true and null/absent
  • false and null/absent
or true false null absent

true

true

true

true

true

false

true

false

null

null

null

null

null

null

null

absent

null

null

null

null

The following table summarizes how the software works with the x>or operator. Note that when null or absent form part of an xor operation, the software always returns null

xor true false null absent

true

false

true

null

null

false

true

false

null

null

null

null

null

null

null

absent

null

null

null

null

The following table summarizes how the software works with the not operator.

not true false null absent

not

true

false

null

absent

false

true

null

null

Concatenation operator

As the following table shows, the software ignores the values null and absent when they appear before or after the concatenation character.

& "def" null absent

"abc"

"abcdef"

"abc"

"abc"

null

"def"

null

null

absent

"def"

null

null

Function parameters

When the value of at least one parameter in a DML-Function or a Custom Function is null or absent, the Function returns the value null (except in the case of the Miscellaneous Functions isNull, isNullOrAbsent, replaceIfAbsent, replaceIfNull, and replaceIfNullOrAbsent).

Table values

Tables can contain the value null in a non-key column but not the value absent.

Related Links