Oracle NVL Function

Share on:

Oracle NVL Function:

The NVL function allow you to replace null values with a default value. If the first parameter is null, the function returns the second parameter. If the first parameter have some value then always return first value.

Note := NVL function replaces null value with same type data.

  • Syntax of the NVL() function:
1NVL(elm1, elm2)

For example:= The NVL() function allow two arguments. If the elm1 is null, then NVL() function returns elm2. If elm1 is not null, then NVL() function returns elm1.

1SELECT NVL ('VIKAS','PANDEY') AS COL1 FROM DUAL;

Preview

1SELECT NVL ('VIKAS',NULL) AS COL1 FROM DUAL;

Preview

1SELECT NVL (NULL, 'VIKAS') AS COL1 FROM DUAL;

Preview

1SELECT NVL (NULL, NULL)AS COL1 FROM DUAL;

Preview

You might also like: