Subject RE: [IBO] Foregn Key Problem
Author Jack Cane
There are two tables, contributors and contributions. It should be
Contributions. I sent the wrong DDL. Here it is:

RECREATE TABLE CONTRIBUTIONS
(
CONTRIBUTIONNR INTEGER NOT NULL,
DONORNR INTEGER,
EVENTNR INTEGER,
DONATIONDATE DATE,
DONATIONTYPE CHAR( 20) CHARACTER SET
NONE COLLATE NONE,
DONATIONVALUE DECIMAL( 9, 2),
DEDICATION CHAR( 20) CHARACTER SET
NONE COLLATE NONE,
DONATIONVEHICLE CHAR( 20) CHARACTER SET
NONE COLLATE NONE,
NOTES VARCHAR( 10000) CHARACTER SET
NONE COLLATE NONE
);

tks,

jwc

-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Friday, June 06, 2003 8:03 PM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Foregn Key Problem

Jack,

At 07:18 PM 6/06/2003 -0400, you wrote:
>DDL for the referred table:

Before looking further, would you look at the DDL below and check whether
you have provided the right definitions. The foreign key definition links
INKIND to a table named CONTRIBUTIONS, which you don't show here.

Helen


>RECREATE TABLE CONTRIBUTORS
>(
> CONTRIBUTORNR INTEGER NOT NULL,
> CONTRIBUTORTYPE CHAR( 20) CHARACTER
SET
>NONE COLLATE NONE,
> DATEENROLLED DATE,
> NAME CHAR( 50) CHARACTER
SET
>NONE COLLATE NONE,
> NOTES VARCHAR( 10000) CHARACTER
SET
>NONE COLLATE NONE
>);
>
>DDL for the referring table:
>
>RECREATE TABLE INKIND
>(
> INKINDNR INTEGER NOT NULL,
> CONTRIBUTIONNR INTEGER,
> DESCRIPTION CHAR( 100) CHARACTER
SET
>NONE COLLATE NONE
>);
>
>The foreign-key constraint:
>
>ALTER TABLE INKIND ADD CONSTRAINT FK_INKIND_CONTRIBUTIONS
> FOREIGN KEY (CONTRIBUTIONNR) REFERENCES CONTRIBUTIONS
> (CONTRIBUTIONNR)
> ON DELETE CASCADE
> ON UPDATE NO ACTION;
>
>The Insert query that is failing, taken from the debugger watch window:
>
>Insert into InKind ( ContributionNr, Description ) values( 56, '420 pens' )
>
>I stopped execution at the point where the above query would be the next
>item processed. I then looked at the "Contributors" table and verified that
>a record with primary key value of 56 does in fact exist.





Yahoo! Groups Sponsor

<http://rd.yahoo.com/M=253843.3419661.4700925.1261774/D=egroupweb/S=17050071
83:HM/A=1296220/R=1/SIG=10llilqvb/*http://yp.yahoo.com>

<http://rd.yahoo.com/M=253843.3419661.4700925.1261774/D=egroupweb/S=17050071
83:HM/A=1296220/R=2/SIG=10llilqvb/*http://yp.yahoo.com>
Enter
Business/Category:

And City, State:





___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .


[Non-text portions of this message have been removed]