Re: Null's vs Empty string

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: 1996/11/06
Message-ID: <QvqN1DAT+KgyEwR9_at_jimsmith.demon.co.uk>#1/1


In article <327F5D63.41C6_at_ha.hac.com>, Ed Bruce <Ed.Bruce_at_ha.hac.com> writes
>Paul Brewer wrote:
>>
>> I am not an expert, but I think there might be more to this than meets
>> the eye.
>> Seems to me that Oracle has always treated an empty string as null.
>> They aren't the same (and I believe future versions of Oracle will
>> distinguish).
>
>Well it depends. In SQLPLUS blank strings are blank strings (talking
>VARCHAR2 here). But I missed the fine print that said Pro*Ada (and I
>assume other Pro*(whatevers)) treats a space filled string as a null. So
>it seems to me you need to experiment with whatever method you are using
>to insert data to see how it treats space filled VARCHAR2 types.
>

There is a difference between an empty string ('') and a blank string (' '); The original poster was tajking about converting some Ingres code which behaves properly and differentiates between NULL and ''.

Oracle has always treated an empty string as NULL. This is contrary to ANSI rules and Oracle are committed to changing it. I asssume it will have to be a switchable option because there is bound to be a huge amount of existing code which relies on the current behaviour.

-- 
Jim Smith
Received on Wed Nov 06 1996 - 00:00:00 CET

Original text of this message