UNIQUE-colum with NULL-Values

UNIQUE-colum with NULL-Values

 

  


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

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