Subject | Foreign key |
---|---|
Author | Meir Kalter |
Post date | 2001-08-17T09:57:31Z |
I have two tables:
person_info AND events
every event MUST hold one from the person_info.
THIS is what i recive when i do extract :
CREATE TABLE EVENTS (
EVENT_ID DOUBLE PRECISION NOT NULL,
PERSON_INFO_ID DOUBLE PRECISION NOT NULL,
CONSTRAINT EVENTS_PK PRIMARY KEY (EVENT_ID)
);
/* Table: PERSON_INFO */
CREATE TABLE PERSON_INFO (
PERSON_INFO_ID DOUBLE PRECISION NOT NULL,
CONSTRAINT PERSON_INFO_PK PRIMARY KEY (PERSON_INFO_ID)
);
ALTER TABLE EVENTS ADD CONSTRAINT "pii" FOREIGN KEY (PERSON_INFO_ID)
REFERENCES PERSON_INFO(PERSON_INFO_ID);
My problem is when i try to insert data with a value of person_info_id
to events when there is no such person_info_id i recive error:
ISC ERROR CODE : 33554466
.
it was before i added the person_info_id constraint to events.
Could somebody help me?
person_info AND events
every event MUST hold one from the person_info.
THIS is what i recive when i do extract :
CREATE TABLE EVENTS (
EVENT_ID DOUBLE PRECISION NOT NULL,
PERSON_INFO_ID DOUBLE PRECISION NOT NULL,
CONSTRAINT EVENTS_PK PRIMARY KEY (EVENT_ID)
);
/* Table: PERSON_INFO */
CREATE TABLE PERSON_INFO (
PERSON_INFO_ID DOUBLE PRECISION NOT NULL,
CONSTRAINT PERSON_INFO_PK PRIMARY KEY (PERSON_INFO_ID)
);
ALTER TABLE EVENTS ADD CONSTRAINT "pii" FOREIGN KEY (PERSON_INFO_ID)
REFERENCES PERSON_INFO(PERSON_INFO_ID);
My problem is when i try to insert data with a value of person_info_id
to events when there is no such person_info_id i recive error:
ISC ERROR CODE : 33554466
.
it was before i added the person_info_id constraint to events.
Could somebody help me?