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: NULL and zero length strings ?

Re: NULL and zero length strings ?

From: Kenneth C Stahl <BluesSax_at_Unforgettable.com>
Date: Tue, 20 Jul 1999 08:09:40 -0400
Message-ID: <37946704.65148C9@Unforgettable.com>


Paolo Bormida wrote:

> Hi all !
>
> I have to admit I am somewhat new to Oracle and just discovered ORACLE 7.3.4
> is treating a zero length string (like this '') as NULL.
>
> We have an application sending INSERT statements on a table with
> not-nullable char/varchar columns; running it against ORACLE we have a few
> problems..
>
> Any idea on how to solve this problem...
>
> Any session option to set ?

From the way it sounds, you are trying to put zero length strings in a not-null column. You need to divorce your thinking from all other programatic languages and think in terms of how Oracle works. In the Oracle world currently (there is a hint that this will change at some point in the future), a zero-length string IS a null string and therefore you cannot put a zero-length string into a non-null column. You either need to modify the table to make the column nullable (preferred) or else insert a dummy value into the column (which is a waste of space).

Ken Received on Tue Jul 20 1999 - 07:09:40 CDT

Original text of this message

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