nvl()
If the expression to be evaluated is not null
, this returns the value of the expression, and if it is null
, it returns the default value.
Syntax
nvl(VAL_EXPR, DEFAULT_EXPR)
Required Parameter
VAL_EXPR
- Expression to be evaluated. If the evaluated value is not
null
, the function returns the evaluated value. DEFAULT_EXPR
- Value to be returned when the
VAL_EXPR
value isnull
.
Usage
json "{}" | eval nvl=nvl("hello", "") => "hello"
json "{}" | eval nvl=nvl(null, "") => ""