Subject Re: [firebird-support] compound FK fails
Author Nick Upson
I do commit, I even disconnected and reconnected

On 03/03/2008, Helen Borrie <helebor@...> wrote:
> At 12:45 AM 4/03/2008, you wrote:
> >I can't see why this is failing, I know it's not great structure but I
> >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.
>
> You'll have to commit the other stuff before attempting the create the FK.
>
> ./heLen
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>