Subject | Re: PK question |
---|---|
Author | didiergm |
Post date | 2002-03-13T14:15:47Z |
Claudio,
I am puzzled since I deleted all records from the table & could create
the PK OK without anymore modification.
I have added the exact same values after creating the PK and it's fine
so I am puzzled.
Note: this DB is under heavy development, that could be a reason. May
be I should backup & restore in a fresh db just to check.
Didier
I am puzzled since I deleted all records from the table & could create
the PK OK without anymore modification.
I have added the exact same values after creating the PK and it's fine
so I am puzzled.
Note: this DB is under heavy development, that could be a reason. May
be I should backup & restore in a fresh db just to check.
Didier
--- In ib-support@y..., "Claudio Valderrama C." <cvalde@u...> wrote:
> ""didiergm"" <Didiergm@n...> wrote in message
> news:a6lsri+obot@e...
> > >
> > 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