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
  • 390,936
  • 96
  • 800
  • 764
Jens Schauder
  • 70,783
  • 26
  • 162
  • 317
  • 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
  • 126,319
  • 20
  • 218
  • 255
  • 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