Does anyone know, why Oracle\'s NVL (and NVL2) function always evaluate the second parameter, even if the first parameter is not NULL?
NVL
NVL2
NULL
It's always been that way, so Oracle has to keep it that way to remain backwards compatible.
Use COALESCE instead to get the short-circuit behaviour.
COALESCE