Subject Re: [ib-support] Re: PK question
Author Claudio Valderrama C.
""didiergm"" <Didiergm@...> wrote in message
news:a6lsri+obot@......
> >
> There are already 3 records inthe table
> 1st record FieldA = 'independent', FieldB = 37, FieldC= 7
> 2nd record FieldA = 'independent', FieldB = 3, FieldC= 0
> 3rd record FieldA = 'IOS', FieldB = 6, FieldC= 1
>
> attempt to store duplicate value (visible to active transactions) in
> unique index "RDB$PRIMARY48"
> null segment of UNIQUE KEY

It sounds like this:
http://sourceforge.net/tracker/?func=detail&atid=109028&aid=440543&group_id=
9028
but it was closed months ago.

Null segment means that one of the fields wasn't defined as not null
initially. Failing that, it seems corruption.

I tried this:
H:\ibdev\fbcvs\interbase\jrd>isql \proy\fbcrash.gdb
Database: \proy\fbcrash.gdb
SQL> create table pk3(fa varchar(15) not null, fb int not null, fc int not
null);
SQL> insert into pk3 values('independent', 37, 7);
SQL> insert into pk3 values('independent', 3, 0);
SQL> insert into pk3 values('IOS', 6, 1);
SQL> alter table pk3 add constraint mypk primary key(fa, fb, fc);
SQL> commit;
SQL> show table pk3;
FA VARCHAR(15) Not Null
FB INTEGER Not Null
FC INTEGER Not Null
CONSTRAINT MYPK:
Primary key (FA, FB, FC)
SQL>

No problem.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing