Why are NVL functions called "NVL"?

18,611

As others have pointed out in comments, it probably stands for "null value" or "null value logic". It might just as well be called "dflt" (or similar abbreviation) for "default".

And, in Java, it should really be using generics so that it can work on any type ;)

Share:
18,611
c0rp
Author by

c0rp

PhD of Computer Science. Java developer

Updated on June 15, 2022

Comments

  • c0rp
    c0rp almost 2 years

    Sometimes I see an nvl() function in code. In the case of Java, it looks like this:

    public static String nvl(String value, String alternateValue) {
        if (value == null)
            return alternateValue;
    
        return value;
    }
    

    I understand what this function does, but I don't understand why it's called nvl. Why not checkNotNull or returnNotNull? What does NVL stand for?

    I guess Null Value L...?