invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

NVL

Syntax

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> NVL[NVL]:::quoted
    NVL --> End((END))

Purpose

The NVL SQL function coalesces all values together.

See also COALESCE.

Parameters:

  • Position 1 (ANY): a value.
  • Position n (optional, ANY): more values.

Returns: All values coalesced together.

Examples

The following example retrieves the first value not being null:

select nvl(null, 'a')

-------------------
a

The following example retrieves the first value not being null from a longer list of values:

select nvl(null, null, 'b', null, null)

-------------------
b