Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2007
    Posts
    25

    Unanswered: is null or nvl()

    im trying to select * information about a product where its name is populated and i dont know if is not null or nvl() is better???
    any suggestions

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    IS NOT NULL is better, because it's standard, and thus also portable
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Alternatively, you could use the COALESCE() function. This is also SQL. NLV is only a proprietary extension of MS SQL Server.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Quote Originally Posted by stolze
    NLV is only a proprietary extension of MS SQL Server.
    I know absolutelly nothing about MS SQL Server, but I know that Oracle offers the NVL function.

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Quote Originally Posted by Littlefoot
    I know absolutelly nothing about MS SQL Server, but I know that Oracle offers the NVL function.
    Same thing. COALESCE is what the SQL standard defines. NVL is a proprietary extension that provides the same functionality as COALESCE. If you want to stick to portable SQL, COALESCE would be your best choice.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Oh, I'm not saying a word about the COALESCE; I was just complaining about the proprietary term.

    Webopedia:
    Privately owned and controlled. In the computer industry, proprietary is the opposite of open. A proprietary design or technique is one that is owned by a company. It also implies that the company has not divulged specifications that would allow other companies to duplicate the product.
    eLook:
    protected by trademark or patent or copyright; made or produced or distributed by one having exclusive rights
    All I wanted to say was that - if I correctly understood what proprietary means - NVL is not proprietary of Microsoft. If I'm wrong about it, I apologize.

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Littlefoot
    NVL is not proprietary of Microsoft. If I'm wrong about it, I apologize.
    no need

    NVL doesn't even exist in SQL Server
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  8. #8
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Now I know the reason for your response. For me, "proprietary" means that it is not standardized.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  9. #9
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I'd call it charm of English as a foreign language. Perhaps it is time to take a dictionary and see what it says about something being proprietary.

  10. #10
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    in Viper 2 - next version of DB2 now in beta release at the moment, NLV function will be supported in DB2 too. COALESCE is a standard, but NLV uses Oracle one of the biggest RDMBS (if not the first) of market share and IBM wants to get Oracle users to DB2. To make application migration easer this is obvious step. In terms of commodization.
    Hope this helps,
    Grofaty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •