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: empty string, NULL, NOT NULL

Re: empty string, NULL, NOT NULL

From: Antoine BRUNEL <abrunel_at_fr.oracle.com>
Date: Fri, 07 Jan 2000 09:50:30 +0100
Message-ID: <3875A8D5.B3B2336@fr.oracle.com>

> could you tell me for a field what these things would mean viz.
> if I say a colume as allows NULL and then if its varchar2,
> could I use in where clause empty string?
> where col = ''
> I tried it and it was not matching it. so could one explain me if
> '' and NULL are same or is '' a valid empty string.
>

Null, and '' are not the same thing. Null means what i mean: there is no data. '' (blank), is a data, however its length is 0. Be careful in your where clause: where col= '' will not return null rows. And where col is null won't return blank rows. To find both nulls and blank value, you must say where col='' OR col is null

>
> Then when I say the col as NOT NULL can I insert '' into it for
> varchar2.

If your col is NULL, you can insert both NULL and blank values. But if your col is NOT NULL, you must insert some data in it, even blank


Received on Fri Jan 07 2000 - 02:50:30 CST

Original text of this message

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