Skip Headers
Oracle® OLAP DML Reference
11g Release 2 (11.2)

Part Number E17122-07
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub
OLADM625

NVL2

The NVL2 function returns one value when the value of a specified expression is not NA or an empty string, or another value when the value of the specified expression is an empty string or NA.

To replace a NA value or an empty string with a string, use NVL.

Return Value

The data type of the return value is always the data type of expr2 (that is, the expression whose value is returned when the value of expr1 is not NA).

Syntax

NVL2 (expr1 , expr2 , expr3)

Parameters

expr1

The expression whose value this function evaluates.

expr2

An expression whose value is returned when the value of expr1 is not an empty string or NA.

expr3

An expression whose value is returned when the value of expr1 is NA.

Usage Notes

OLADM1803Comparing Values of Different Data Types

When the data types of expr2 and expr3 are different, then the function converts expr3 to the data type of expr2 before comparing them.

Examples

OLADM1804Example 8-46 Working with NVL2

SHOW NVL2('Which string?', 'First String', 'Second String')
First String
 
SHOW NVL2('', 'First String', 'Second String')
Second String
Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF