Why does Oracle 9i treat an empty string as NULL?

后端 未结 10 1517
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-21 23:39

I know that it does consider \' \' as NULL, but that doesn\'t do much to tell me why this is the case. As I understand the SQL specifications

10条回答
  •  日久生厌
    2020-11-22 00:21

    Because not treating it as NULL isn't particularly helpful, either.

    If you make a mistake in this area on Oracle, you usually notice right away. In SQL server, however, it will appear to work, and the problem only appears when someone enters an empty string instead of NULL (perhaps from a .net client library, where null is different from "", but you usually treat them the same).

    I'm not saying Oracle is right, but it seems to me that both ways are approximately equally bad.

提交回复
热议问题