Show TOC

Background documentationDynamic Expression Keywords Locate this document in the navigation structure

 

Keyword

Description

Examples

null

Represents an undefined value (not an empty string).

null can be used as an argument for any operator or function in a dynamic expression.

The null keyword is subject to all the rules that govern the behavior of undefined values. Specifically:

  • Operators that involve one or more null operands evaluate to the undefined value.

  • A function that is passed null values to one or more required parameters is evaluated to the undefined value.

  • A function that is passed null values to one or more optional parameters is invoked as though those parameters were omitted, and thus is evaluated using the default values of the parameters.

Note Note

There are several exceptions to the way that the null keyword behaves. Refer to the Special Cases for Null Keyword Behavior section below this table for more information.

End of the note.

23 – 5 * null

This expression would return undefined.

LEFT(null, 5)

This expression would return undefined.

LEFT("ABC", null)

This expression would return “A”.

true

Represents the logical value TRUE.

IF(true,’this will be returned’,’false value’)

false

Represents the logical value FALSE.

IF(false,’true value’,’this will be returned’)

Special Cases for Null Keyword Behavior

Following are exceptions to the rules for null keyword behavior listed above, together with examples of each special case:

  • Concatenating null to a valid string treats the null keyword as the empty string.

    For example:

    "ABC" & null

    This expression would return “ABC”.

    null & null

    This expression would return undefined.

  • Boolean operators (AND,&&,OR,||) use lazy evaluation and ignore redundant operands.

    For example:

    true OR null

    This expression would return true.

    false AND null

    This expression would return false.

    null OR true

    null AND false

    These expressions would return undefined.

  • The FORMAT function treats undefined values as empty strings.

    For example:

    FORMAT("{1}-{2}", null, 10)

    This expression would return “-10”.

    FORMAT(null, ”A”, null)

    This expression would return “”.

  • The MAX/MIN functions evaluate to the undefined value if any of their parameters are undefined.

    For example:

    MAX(1,2,3,null)

    This expression would return undefined.

  • The NVL function skips all undefined values and returns the first non-empty parameter.

    For example:

    NVL(null, "B")

    This expression would return “B”.

  • The ISNULL function returns true if its parameter is undefined, otherwise it returns false.

    For example:

    ISNULL(null)

    This expression would return true.

  • The IF function evaluates null to false.

    For example:

    IF(null, 1, 2)

    IF(false, null, 2)

    IF(true, 2, null)

    These expressions would return 2.