Oracle NVL Functions

NVL è un utile funzione Oracle che consente di sostituire NULL con una stringa.

Sintassi

NVL(expr1, espr2)

Se expr1 è nullo, poi ritorna NVL espr2. Se espr1 non è nullo, poi ritorna espr1.

Alcuni esempi:

-- Restituisce "X"
SELECT NVL(DUMMY, 'Not Applicable')
FROM dual

-- Restituisce "Not Applicable"
SELECT NVL(NULL, 'Not Applicable')
FROM dual

-- Restituisce "Not Applicable"
SELECT NVL('', 'Not Applicable')
FROM dual

Per maggiori dettagli http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions105.htm

This entry was posted in Database, Oracle, Structured Query Language. Bookmark the permalink.