Trying to fire this ALTER Query with MySQL Workbench (newest) on a MacBook Pro. When i use this query it works, but with wrong "on delete" action: ALTER TABLE `katalog`ĪDD FOREIGN KEY (`Sprache` ) REFERENCES `sprache` (`ID` )īoth tables are InnoDB and both fields are "INT(11) not null". Mytable.#sql-7fb1_7d3a: FOREIGN KEY (`Sprache`) Can't create table 'mytable.#sql-7fb1_7d3a' (errno: 150)ġ20405 14:02:57 Error in foreign key constraint of table When I try to do this, I get this error message: Error Code: 1005. The SET NULL option offered by MySQL means that if a row in one table is updated or deleted, the column with the foreign key will have its values set to NULL. A FOREIGN KEY is a field (or collection of fields) in one table. I want to add a Foreign Key to a table called "katalog". The FOREIGN KEY constraint is used to prevent actions that would destroy links between tables. A foreign key relationship involves a parent table that holds the initial column values, and a child table with column values that reference the parent column.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |