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: Cannot insert '' into NOT NULL column

Re: Cannot insert '' into NOT NULL column

From: Tony <andrewst_at_onetel.net.uk>
Date: 18 Mar 2004 12:34:57 -0800
Message-ID: <c0e3f26e.0403181234.c6fb510@posting.google.com>


laredotornado_at_zipmail.com (D. Alvarado) wrote in message news:<9fe1f2ad.0403180749.53a2a394_at_posting.google.com>...
> Hello,
> I'm running Oracle 8.1.7 for Solaris. I have a situation where I
> want my primary key to potentially include a '' value. However, it
> appears Oracle treats '' the same as NULL, and of course, NULLs are
> not allowed in primary keys. Is there anything I can do to allow the
> oclumn to have a '' value AND index the column in some way? Or is the
> only solution to hard code into my application that if inserting a '',
> change it to something non-empty before the insert occurs?
>
> Thanks - Dave

As you say yourself:
1) '' and NULL are synonymous in Oracle
2) a primary key cannot contain a NULL (i.e. cannot contain '')

The only way around this is NOT to use '' as a value! Received on Thu Mar 18 2004 - 14:34:57 CST

Original text of this message

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