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 - Proof Oracle Supports Zero Length Strings

Re: VARCHAR2: NULL value vs. empty string - Proof Oracle Supports Zero Length Strings

From: Ken Denny <ken_at_kendenny.com>
Date: Thu, 18 Dec 2003 01:37:35 GMT
Message-ID: <Xns9454D14947ED5kendenny@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.

-- 
Ken Denny
http://www.kendenny.com/
Received on Wed Dec 17 2003 - 19:37:35 CST

Original text of this message

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