General discussion


null and empty string

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 ?

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

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.

Collapse -

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.

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums