4

As everybody working with Oracle knows, it an empty Varchar2 will result in a NULL value when put into a Varchar2 column.

I (and a coworker as well) thought we had read about a parameter that could be set in the database to change that behavior and actually differentiate between null values and empty Strings.

Is there such a parameter in the new versions? (We think since 10g)

Or is there a parameter which we might confuse with it with?

skaffman
  • 398,947
  • 96
  • 818
  • 769
Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
  • I don't think there is... See also the answers to tgus question: http://stackoverflow.com/questions/203493/why-does-oracle-9i-treat-an-empty-string-as-null – Robert Petermeier Aug 25 '10 at 09:47

1 Answers1

6

No, Oracle internally stores empty strings and nulls identically, so it cannot distinguish between them whether it wants to or not! Both are stored as a zero character count and no other data.

Tony Andrews
  • 129,880
  • 21
  • 220
  • 259
  • 5
    Correct - that's one reason it's VARCHAR2; VARCHAR is reserved for if someday Oracle implements ANSI-compliant empty-string behavior. – Adam Musch Aug 25 '10 at 11:26