Hello experts
I am trying to create innodb tables with foreign key relations but I get
error 150 meaning that foregin key constraint can't be established.
Here are the statements
1.CREATE TABLE relation( type VARCHAR(50) NOT NULL PRIMARY KEY)TYPE =
INNODB;
2.CREATE TABLE person( name VARCHAR(50) NOT NULL PRIMARY KEY, type
VARCHAR(50) NOT NULL, dob DATE,
FOREIGN KEY(type) REFERENCES
relation(type) ON DELETE CASCADE ) TYPE = INNODB ;
But if I remove the type = innodb in the second statement, it is executed.
Then I am using the ALTER TABLE syntax to create innodb tables.
Any advice to avoid this alter table syntax? Or my create statement is
wrong?
Thanks in advance
Regards
Kayamboo Suresh
sql,query,mysql
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php