As far as I know, if I define a column as varchar2(or other char data type) in Oracle and insert an empty string to that column, Oracle will treat this column the same as null. This implementation is NOT the same as sql server, which can differentiate an empty string and a null value.
So is this a configurable feature? i.e. can we change some settings so Oracle can also tell the difference between an empty string and null?
No. This is where SQLServer has it right an Oracle does not.
Take for example, LastName. In the case of my neighbor Randy, I don't know his last name. Therefore, a value of NULL signifies that fact; an unknown value. On the other hand, Cher doesn't have a last name. An empty string would convey that fact; no data exists. However, the fact that Oracle converts an empty string to a NULL perverts the meaning of NULL at worst, or eliminates the ability to specify a value that is known to not exist at best.
Basically, there is definitely a difference between NULL and empty, or a value that is not known vs. one that is known to not exist. I completely agree that these values should be treated differently, but they are not. And as I said before, I don't know of any way to change this functionality.
Bookmarks