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

Re: empty string == NULL

From: TurkBear <johng_at_mm.com>
Date: Thu, 23 Dec 1999 15:39:16 GMT
Message-ID: <386240ae.3210035@super.news-ituk.to>

You can specify ' ' ( that/s a space between the quotes ) - that will not be NULL'ed by Oracle - see the following:



SQL> create table test_null(
  2 field1 varchar2(10) not null,
  3 field2 number(1));

Table created.

SQL> insert into test_null values('',1); /* no space between the quotes */ insert into test_null values('',1)

            *
ERROR at line 1:
ORA-01400: mandatory (NOT NULL) column is missing or NULL during insert

SQL> insert into test_null values(' ',1); /* space between quotes */

1 row created.



hth,
John Greco

"Andreas Steidle" <andreas_at_fh-konstanz.de> wrote:

>From the oracle doc:
>
>Do not use null to represent a value of zero, because they are not
>equivalent. (Oracle currently treats a character value with a length of zero
>as null. ... [1])
>
>Is there a workround for this contardictory semantik garbage? A string is a
>string, even if it's empty!!! Perhaps some env-var??
>In other words: Is there a way to make Oracle remember a '' and NOT convert
>it to NULL ???
>
>thanx, Andreas
>
>
>[1] However, this may not continue to be true in future releases, and Oracle
>recommends that you do not treat empty strings the same as NULLs.
>
>Hope this will happen very soon as default behavoir.
>
>
>

  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------    http://www.newsfeeds.com The Largest Usenet Servers in the World! ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==----- Received on Thu Dec 23 1999 - 09:39:16 CST

Original text of this message

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