Skip to main content

Lain Inverse

Member since Oct 21, 2012

Recent Blog Comments By Lain Inverse

  • Using NULLIF() To Prevent Divide-By-Zero Errors In SQL

    Posted on Jun 10, 2013 at 12:28 PM

    @Mohammad, I guess you meant COALESCE() which is mentioned in the article. Yes, it's more widely implemented while Oracle uses NVL instead of ISNULL but each function have own purpose. COALESCE is more complex function and capable to accept any number of parameters while isnull/nvl are tailored to ... read more »

  • Using NULLIF() To Prevent Divide-By-Zero Errors In SQL

    Posted on Oct 21, 2012 at 3:29 AM

    Addendum: In case when divisor could be NULL it's important to NVL it to ZERO. At least Oracle's implementation of NULLIF doesn't accept NULL value as valid parameter and returns error message about it. So, in complete form it looks like: nullif(nvl(divisor,0),0) NVL will change NULL on 0 and NU... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel