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

Home -> Community -> Usenet -> c.d.o.server -> Re: Why are empty VARCHAR2S always NULL?

Re: Why are empty VARCHAR2S always NULL?

From: Wolfram Roesler <wr_at_grp.de>
Date: Thu, 22 Aug 2002 09:16:20 +0200
Message-ID: <Xns92725EFEDC72Bwrgrpde@62.153.159.134>


"Niall Litchfield" <niall.litchfield_at_dial.pipex.com> wrote in news:3d63f43d$0$231$cc9e4d1f_at_news.dial.pipex.com:

>> > What
>> > representation would you use for unknown.
>>
>> Null.

>
> The 4 characters 'NULL' or an empty string or what? I may be missing
> something here (not being a cs major an all) but what do you put in
> the oracle character datatype - or how do you modify it - to represent
> null if not an empty string.

To make it unknown:

        UPDATE table SET colname=NULL WHERE ...;

To make it known but empty:

        UPDATE table SET colname='' WHERE ...;

To test if it's unknown:

        SELECT * FROM table WHERE colname IS NULL;

To test if it's known:

        SELECT * FROM table WHERE colname IS NOT NULL;

To test if it's known and empty:

        SELECT * FROM table WHERE colname='';

Regards
W. Roesler Received on Thu Aug 22 2002 - 02:16:20 CDT

Original text of this message

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