Hello everybody
I`m trying to create these three InnoDB tables with constraints. The create statements are as shown below :
CREATE TABLE TYPOS(Kwd_Typou INTEGER UNSIGNED AUTO_INCREMENT,
Onomasia VARCHAR(15) NOT NULL,
Kataskeyasths VARCHAR(15),
PRIMARY KEY(Kwd_Typou),
INDEX Kwd_Typou_ind (Kwd_Typou)) TYPE=INNODB;
CREATE TABLE KLINIKH(Kwd_Klinikhs INTEGER UNSIGNED AUTO_INCREMENT,
Onomasia VARCHAR(20),
PRIMARY KEY(Kwd_Klinikhs),
INDEX Kwd_Klinikhs_ind (Kwd_Klinikhs)) TYPE=INNODB;
CREATE TABLE MHXANHMA(Kwd_Mhxanhmatos INTEGER UNSIGNED AUTO_INCREMENT,
Kwd_Klinikhs INTEGER UNSIGNED NOT NULL,
Kwd_Typou INTEGER UNSIGNED NOT NULL,
Onomasia VARCHAR(15) NOT NULL,
Seriakos_Arithmos VARCHAR(15),
INDEX Kwd_Klinikhs_ind (Kwd_Klinikhs),
INDEX Kwd_Typou_ind (Kwd_Typou),
FOREIGN KEY (Kwd_Klinikhs_ind) REFERENCES KLINIKH(Kwd_Klinikhs_ind) ON DELETE SET NULL,
FOREIGN KEY (Kwd_Typou_ind) REFERENCES TYPOS(Kwd_Typou_ind) ON DELETE SET NULL,
PRIMARY KEY(Kwd_Mhxanhmatos)) TYPE = INNODB;
Unfortunately the final create table statement fails with an error code 150. Is there something wrong with my constraints here?
thx, in advance
George Papadopoulos