Subject Re: [IBO] error Singleton
Author Lucas Franzen
Hi Dion,

Dion schrieb:
>
> Hi Sven,
>
> I did not create a primary key. While we are on the topic. From your
> experience, is it better to generate a unique key than use, say a composite
> key of three values. In this case, PERSONID, OPTIONNAME and FUNDNO uniquely
> identify a Fund policy.

This might be the case from your experience, but in the database they're
not declared to form a unique value.

In my experience it is much better to give each record in each table a
primary key; the best way to achieve this is to use generators.

If you want to get your query updatable you have to enter all the fields
that make up the uniqueness of a record into the KeyLinks property.

So in this case you should try to enter:

PERSONID
OPTIONNAME
FUNDNO


HTH

Luc.

> CREATE TABLE "MEMBERINFUND"
>
> (
>
> "PERSONID" VARCHAR(15) NOT NULL,
>
> "OPTIONNAME" VARCHAR(20) NOT NULL,
>
> "FUNDNO" VARCHAR(20) NOT NULL,
>
> "GROUPNAME" VARCHAR(30) NOT NULL,
>
> "MARKETERID" VARCHAR(15) NOT NULL,
>
> "DOI" DATE NOT NULL
>
> );
>
> ALTER TABLE "MEMBERINFUND" ADD FOREIGN KEY ("PERSONID") REFERENCES MEMBER
> ("PERSONID");
>
> ALTER TABLE "MEMBERINFUND" ADD FOREIGN KEY ("FUNDNO") REFERENCES FUND
> ("FUNDNO");
>
> ALTER TABLE "MEMBERINFUND" ADD FOREIGN KEY ("MARKETERID") REFERENCES PERSON
> ("PERSONID");
>
> ALTER TABLE "MEMBERINFUND" ADD FOREIGN KEY ("GROUPNAME") REFERENCES GROUPS
> ("NAME");
>