Subject Re: [ib-support] varchar foreign keys
Author Svein Erling Tysvær
I cannot answer your original question, but in your example you try to
create a foreign key on a field that is neither a primary nor unique key.

Set

At 10:28 15.01.2001 -0200, you wrote:
>Untitled-1Hello all, I dont know why I cannot make a foreign key work
>between two varchar fields even if it is a primary key.
>Could someone help, please?
>
>I have this case for instance:
>
>CREATE TABLE "FAMILY"
>(
> "COD_FAMILY" FLOAT NOT NULL,
> "INDEX_PROFIT" DOUBLE PRECISION,
> "DES_FAMILY" VARCHAR(25) CHARACTER SET ISO8859_1 NOT NULL COLLATE PT_PT,
>CONSTRAINT "PKFAMILIA_DO_PRODUTO" PRIMARY KEY ("COD_FAMILY")
>);
>
>
>CREATE TABLE "PRODUCT"
>(
> "COD_PRODUCT" FLOAT NOT NULL,
> "DES_PRODUCT" VARCHAR(40) CHARACTER SET ISO8859_1 NOT NULL COLLATE PT_PT,
> "COD_FAMILY" FLOAT NOT NULL,
> "DES_FAMILY" VARCHAR(25) CHARACTER SET ISO8859_1 NOT NULL COLLATE PT_PT,
> "COD_MARK" FLOAT NOT NULL,
> "DES_MARK" VARCHAR(25) CHARACTER SET ISO8859_1 NOT NULL COLLATE PT_PT,
> "TYPE_PRODUCT" VARCHAR(1) CHARACTER SET ISO8859_1 default '0' NOT NULL
>COLLATE PT_PT,
> "COD_CTAX" FLOAT NOT NULL);
>
>Why I cannot set a foreign key fkPRODUCT_FAMILY on product des_family and
>family des_family?
>
>
>
>
>
>
>
>
>
>
>To unsubscribe from this group, send an email to:
>ib-support-unsubscribe@egroups.com
>
>
>
>