Subject Re: [ib-support] PK question
Author Paul Reeves
Didier Gasser-Morlay wrote:
>
> Now my question: I am trying to create a primary key with three fields :
> FieldA, FieldB and FieldC. The three fields are not null obviously. In
> my mind, the uniqueness is evaluated by combining the three fields
> values and the result must be unique. It seems though that as soon as
> fieldA has got the same value in more than one record, then the PK
> creation is rejected.
>

What do you mean by 'the PK creation is rejected'? Is the DDL statement
rejected or the insert statement rejected?

> I know this is not the right thing to do (I should have a small PK, with
> only one field), but this is a very small table & I need to check the
> uniqueness of three fields out of four.

Unique indexes are the way to go - whether they are called primary keys
(implicitly unique) or not. Whether you choose to have a surrogate key
on a single field and a unique index on another set of fields or a
primary key on those same fields shouldn't make any difference.


Paul
--

Paul Reeves
http://www.ibphoenix.com
taking InterBase further