Hello everybody
I`m trying to create two tables. The SQl statements I use are given below :
CREATE TABLE TYPOS(Kwd_Typou VARCHAR(7) NOT NULL,
Onomasia VARCHAR(15) NOT NULL,
INDEX Onomasia_ind (Onomasia),
PRIMARY KEY(Kwd_Typou)) TYPE=INNODB;
CREATE TABLE MONTELO(Kwd_Montelou VARCHAR(7) NOT NULL,
Kwd_Typou VARCHAR(7) NOT NULL,
Onomasia VARCHAR(30) NOT NULL,
Kataskeyasths VARCHAR(30),
Antiproswpos VARCHAR(30),
INDEX Kwd_Typou_ind (Kwd_Typou),
INDEX Onomasia_ind (Onomasia),
INDEX Kataskeyasths_ind (Kataskeyasths),
FOREIGN KEY(Kwd_Typou) REFERENCES TYPOS(Kwd_Typou) ON DELETE SET NULL,
PRIMARY KEY(Kwd_Montelou)) TYPE=INNODB;
i get an errno 150 on the second statement. If you`ve noticed the foreign key in the second table is also a primary key of the first table! Is there something special in this case? Any ideas on how I can create the second table with the constraints shown in the code?
thx, in advance
George Papadopoulos