Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: VARCHAR2: NULL value vs. empty string - Oracle is NOT ANSI

Re: VARCHAR2: NULL value vs. empty string - Oracle is NOT ANSI

From: Frank van Bortel <fvanbortel_at_netscape.net>
Date: Sat, 03 Jan 2004 12:41:45 +0100
Message-ID: <bt697v$iqm$1@news4.tilbu1.nb.home.nl>


Tony wrote:

> Ken Denny <ken_at_kendenny.com> wrote in message news:<Xns9454D14947ED5kendenny_at_216.77.188.18>...
> 

>>OK damnit.
>>
>>Daniel Morgan <damorgan_at_x.washington.edu> wrote in
>>news:1071425957.927085_at_yasure:
>>
>>[snip old stuff]
>>
>>>-- here's the table
>>>CREATE TABLE t (x sys.anyData);
>>>
>>>-- here's the insert statement
>>>INSERT INTO t
>>>VALUES (sys.anyData.convertVarchar2(''));
>>
>>OK now change the value to: sys.anyData.convertVarchar2(NULL)
>>and tell me if it changes anything.
>>
>>>COL typeName FORMAT a20
>>>
>>>-- proof the row was stored
>>>SELECT COUNT(*) FROM t;
>>
>>So what if the row was stored. Does the data item have a "NOT NULL"
>>constraint?
>>
>>>-- proof the data type is VARCHAR2
>>>SELECT t.x.gettypeName() typeName
>>>FROM t t;
>>>
>>>Now you have the proof.
>>>
>>>If you want to retrieve that empty string you will need to either go to
>>>http://tahiti.oracle.com and learn how to use the anyData data type or
>>>take my class at the University of Washington. I have two open seats
>>>for the Winter Quarter starting in January ;-)
>>
>>Show us a sample SQL where substituting '' and NULL as a VARCHAR2 value
>>produces a different result.
> 
> 
> Ever noticed how once their position becomes indefensible, most
> posters never respond with "OK, I was wrong, you are right"?  Instead
> they merely ignore the thread altogether...

Which seems the best thing to do, with a zealot like Daniel.

-- 
A prosperous 2004,
Regards,
Frank van Bortel
Received on Sat Jan 03 2004 - 05:41:45 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US