me,myself,english and programming..

Check for NULL Value in Oracle and MySQL

If you are familiar with MS-SQL, you will know that you can use ISNULL function to convert NULL value to something else. In below case, it is an example how to convert NULL value to zero.

ISNULL(myField,0)

In Oracle, you can use NVL to get the same result.

NVL(myField,0)

Same thing for MySQL, you can use IFNULL to get the same result.

IFNULL(myField,0)

 

Don’t under estimate with this function. I’m debugging my program for almost 1 hours just to notice that some values in my Oracle tables having NULL values and causing errors while inserting to MySQL tables.

That’s my quick update for today. Till then…Happy Coding. :)

  1. 2 Responses to “Check for NULL Value in Oracle and MySQL”

  2. By Pawan Chand on Jun 10, 2009 | Reply

    thnks for your kind help

  3. By debas on Jul 8, 2009 | Reply

    Nice and helpfull

Post a Comment