Re: UNIQUE-colum with NULL-Values

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
>
>

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