Subject UNQ problems ...
Author Jorge Andrés Brugger
I´ve a table defined as:

CREATE TABLE CORRESPONDENCIA_FARMACLICK (
CODIGO_PLAN D_CODIGO_PLAN NOT NULL,
CODIGO_REGIMEN D_CODIGO_REGIMEN NOT NULL,
CODIGO_PLAN_FARMACLICK SMALLINT
);

ALTER TABLE CORRESPONDENCIA_FARMACLICK ADD CONSTRAINT
PK_CORRESPONDENCIA_FARMACLICK PRIMARY KEY (CODIGO_PLAN, CODIGO_REGIMEN);

Actual data is:

CODIGO_PLAN CODIGO_REGIMEN CODIGO_PLAN_FARMACLICK
1 1 2
1 9 12
2 3 6
2 8 17
3 1 11
3 5 3
3 6 19
3 7 18
4 2 4
4 4 5

Now, the following statement:

ALTER TABLE CORRESPONDENCIA_FARMACLICK ADD CONSTRAINT
UNQ1_CORRESPONDENCIA_FARMACLICK UNIQUE (CODIGO_PLAN_FARMACLICK);

produces:

Invalid insert or update value(s): object columns are
constrained - no 2 table rows can have duplicate column values.
attempt to store duplicate value (visible to active transactions) in
unique index "UNQ1_CORRESPONDENCIA_FARMACLICK".

There are no other users connected, and I´m even restarted Firebird with
same results.

Using Firebird 2.1.1 on Ubuntu Server 9.04

Am I missing something?

Thanks!

--
Jorge Andrés Brugger
Informática
DASU - Obra Social del Personal de la Universidad Nacional de la Patagonia
Comodoro Rivadavia, Chubut, Argentina
Teléfono (0297) 446-4444 int. 103
Correo electrónico: jbrugger@...
Website: www.dasu.com.ar