MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jan Bartholdy Date:June 8 2005 8:23pm
Subject:innoDB and referential action
View as plain text  
Dear All, I have two tables entity1 and entity2; the second one should
contain only data with the same "PLZ" as listed in table "entity1".

Unfortunately, I am able to insert in table entity2 data in the field "PLZ",
different from those in the field PLZ in the table "entity1".

What is going wrong?

Many thanks, Jan

Create table Entity1 (
	PLZ Char(20) NOT NULL,
	Ort Char(20),
	UNIQUE (PLZ),
 Primary Key (PLZ)
) ENGINE = InnoDB
ROW_FORMAT = Default;

Create table Entity2 (
	PLZ Char(20) NOT NULL,
	Stra_e Char(20),
 Primary Key (PLZ),
 Constraint Relationship1 Foreign Key (PLZ) references Entity1 (PLZ) on
delete  restrict on update  restrict
) ENGINE = InnoDB
ROW_FORMAT = Default;


____________
Virus checked by G DATA AntiVirusKit
Version: AVK 15.0.4951 from 19.05.2005

Thread
innoDB and referential actionJan Bartholdy8 Jun
  • Re: innoDB and referential actionGleb Paharenko9 Jun