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: Tony <andrewst_at_onetel.net.uk>
Date: 2 Jan 2004 06:21:25 -0800
Message-ID: <c0e3f26e.0401020621.11e240e6@posting.google.com>


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... Received on Fri Jan 02 2004 - 08:21:25 CST

Original text of this message

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