List of expression elements / Comparison operators |
The NVL() operator returns the second parameter if the first argument evaluates to NULL.
NVL( main-expr, subst-expr )
The NVL() operator evaluates the first argument, and returns the result if the value is not null, otherwise it returns the second argument. This allows you to write the equivalent of the following IF statement, in a simple scalar expression:
IF main-expr IS NOT NULL THEN RETURN main-expr ELSE RETURN subst-expr END IF
MAIN DEFINE var VARCHAR(100) LET var = arg_val(1) DISPLAY "The argument value is: ", NVL(var, "NULL") END MAIN