Subject | Re: [firebird-support] UNQ problems ... |
---|---|
Author | Michael Ludwig |
Post date | 2010-05-10T19:23:43Z |
Jorge Andrés Brugger schrieb am 10.05.2010 um 15:20:14 (-0300):
--
Michael Ludwig
> CREATE TABLE CORRESPONDENCIA_FARMACLICK (Works for me on 2.1.3.
> 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);
> Invalid insert or update value(s): object columns areMaybe try on a fresh database.
> 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.04And maybe a fresh version of Firebird?
--
Michael Ludwig