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: Turkbear <john.g_at_dot.spamfree.com>
Date: Thu, 18 Mar 2004 12:43:48 -0600
Message-ID: <f6rj50ls9gf4gtvb262rlejbp59qeognfv@4ax.com>


laredotornado_at_zipmail.com (D. Alvarado) wrote:

>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

2 Thoughts..
Change the '' to ' ' - A blank string, not a NULL

Or

Instead of a Primary Key use a Unique Index ( it allows for NULLs) ( but, that cannot be used as the 'target' of a Foreign Key)

hth

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- Received on Thu Mar 18 2004 - 12:43:48 CST

Original text of this message

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