General discussion

  • Creator
    Topic
  • #2072727

    null and empty string

    Locked

    by bharat_is ·

    In oracle, if you have a varchar field which is set to ” – > empty string and the same is set = null . Please clarify whether in both the situation the value is one and the same or not? If not, why ?

All Comments

  • Author
    Replies
    • #3783229

      null and empty string

      by aamir abbas ·

      In reply to null and empty string

      Zero-length string (”) and NULL are said to be identical in Oracle 7 documentation but still they suggested not to suppose these as equivalent values because in later version, these values will be having some difference.

      Truly speaking, if you insert ” and NULL values in any VarChar2 column (I’ve tested this in Oracle 8i), they will still be listed under an identical condition (i.e. both will be considered as NULL while if you search for a value containing ”, this will return no rows).

      I suggest you to do not assign ” to any column, rather use NULL. Be careful using NULL values with numeric columns because this will evaluate all your arithmetic expressions as NULL until unless you use NVL function to eliminate it with some valid value.

      Hopefully, you will get a way. Wish you a good luck.

      • #3767382

        null and empty string

        by bharat_is ·

        In reply to null and empty string

        I am asking precisely whether Null and Empty are both equal.

Viewing 0 reply threads