RE: UNIQUE-colum with NULL-Values

RE: UNIQUE-colum with NULL-Values

 

  

No, You cannot have more then one NULL value if you create a unique
index on the column.

Regards,
Kondal YENNARAM
Database Engineering


-----Original Message-----
From: SlowJoe
[mailto:db2udbdba-ezmlmshield-x62049212.[Email address protected]
Sent: Thursday, October 28, 2004 9:37 AM
To: LazyDBA Discussion
Subject: Re: UNIQUE-colum with NULL-Values


Hi Michael,

just create a UNIQUE INDEX on that column.
Regards,

Johannes




Michael Kleiser wrote:
> Is it possibe to define a table
> to allow NULL-values and also defining this column to be unique.
>
> In Oracle this is possible. It is also possible to insert more tahn
> one row with NULL in this column.
>
>
> In DB2 this seems not be possible. I got error SQLSTATE=42831 if I try

> to add an unique-constraint on a NULL-column.
>
> ( version 8.1 on 32 bit Linux )
>
>
> Is there a way to get the oracle-behaviour ?
> Do I have to write a trigger to simulate it ?
>
> regards
> Michael
>
>
> ---------------------------------------------------------------------
> PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> website: http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>


---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


DB2 & UDB email list listserv db2-l LazyDBA home page