Hermann Himmelbauer wrote: > On Monday 22 September 2003 05:51, Kevin Wilson wrote: > > You may have already thought of this but I like to start > with the things I > > always forget. > > > > Is the column you are trying to create the unique index on Nullable? > > You mean, that the column may be Null? Does this make any > difference? To my > mind Null-values are considered as unique, so there is no conflict. > > My table looks like this: > > CREATE TABLE "MOVIE" > ( > "MOVIEID" Fixed(12,0) DEFAULT SERIAL PRIMARY KEY, > "TITEL" Varchar (100) ASCII NOT NULL, > "JAHR" Char (4) NOT NULL, > "SPRACHE" Varchar (20) ASCII NOT NULL, > "FORMAT" Varchar (10) ASCII NOT NULL, > "QUALITAET" Char (1) ASCII NOT NULL, > "CDNO" Varchar (25) ASCII NOT NULL, > "DATEINAME" Varchar (100) ASCII NOT NULL, > "IMDBNO" Varchar (10) ASCII, > "GENRE" Varchar (100) ASCII, > "INHALT" Varchar (1000) ASCII, > "SPIELER" Varchar (300) ASCII > ) > > ... and the SQL-Command like this: > > create unique index m1 on movie(imdbno) > > ... this leads to the following error: > > [SAP AG][LIBSQLOD SO][SAP DB]Integrity constraint > violation;250 POS(1) > Duplicate secondary key.
Hi, The error 250 means that the column imdbno includes non unique data. "select imdbno from movie group by imdbno having count(movieid) > 2" should return such rows. The hint from Kevin is only valid for primary keys which have to be not nullable. Unique indexes instead could be nullable but you should be aware of the fact that you could insert two or more null values into such a column. Best regards, Holger SAP Labs Berlin -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
