Subject | Re: [firebird-support] compound FK fails |
---|---|
Author | Helen Borrie |
Post date | 2008-03-03T19:56:11Z |
At 12:45 AM 4/03/2008, you wrote:
./heLen
>I can't see why this is failing, I know it's not great structure but IYou'll have to commit the other stuff before attempting the create the FK.
>didn't design it.
>
>CREATE TABLE TBLCUSTOMASSETEDIT (
> GROUPID BIGINT NOT NULL,
> ASSETID Integer NOT NULL,
> CONSTRAINT PK_TBLCUSTOMASSETEDIT PRIMARY KEY (GROUPID,ASSETID)
>);
>
>CREATE TABLE TBLCGCHECKGRID (
> GROUPID BIGINT NOT NULL,
> ASSETID Integer NOT NULL,
> CONSTRAINT PK_TBLCGCHECKGRID PRIMARY KEY (GROUPID,ASSETID)
>);
>
>ALTER TABLE TBLCGCHECKGRID ADD CONSTRAINT FK_TBLCGCHECKGRID_1 FOREIGN
>KEY (GROUPID,ASSETID) REFERENCES TBLCUSTOMASSETEDIT(GROUPID,ASSETID)
>ON DELETE CASCADE;
>
>violation of FOREIGN KEY constraint '""'. violation of FOREIGN KEY
>constraint "PK_TBLCUSTOMASSETEDIT" on table "TBLCUSTOMASSETEDIT".
>Foreign key reference target does not exist.
./heLen