|
Ограничение Foreign Key не даёт ничего добавить.
|
|||
---|---|---|---|
#18+
Доброго вечера! Есть 2 таблички: Код: sql 1. 2.
Табличка muscle_groups заполнена. Но при попытке добавить что-либо в табличку muscles появляется ошибка Код: sql 1.
Код: plaintext
Специально прикладываю картинку ошибки. Не понимаю где я ошибся, в создании Foreign Key или в синтаксисе где-то... Какое бы из существующих значений поля groups таблички muscle_groups я не подставлял последним параметром в моём инсёрте. ... |
|||
:
Нравится:
Не нравится:
|
|||
23.05.2016, 21:38 |
|
Ограничение Foreign Key не даёт ничего добавить.
|
|||
---|---|---|---|
#18+
[quote З.Ф. Мануал ]If the database schema contains foreign key errors that require looking at more than one table definition to identify, then those errors are not detected when the tables are created. Instead, such errors prevent the application from preparing SQL statements that modify the content of the child or parent tables in ways that use the foreign keys. Errors reported when content is changed are "DML errors" and errors reported when the schema is changed are "DDL errors". So, in other words, misconfigured foreign key constraints that require looking at both the child and parent are DML errors. The English language error message for foreign key DML errors is usually "foreign key mismatch" but can also be "no such table" if the parent table does not exist. Foreign key DML errors are may be reported if: The parent table does not exist, or The parent key columns named in the foreign key constraint do not exist, or The parent key columns named in the foreign key constraint are not the primary key of the parent table and are not subject to a unique constraint using collating sequence specified in the CREATE TABLE, or The child table references the primary key of the parent without specifying the primary key columns and the number of primary key columns in the parent do not match the number of child key columns. [/quote] ... |
|||
:
Нравится:
Не нравится:
|
|||
23.05.2016, 22:16 |
|
|
start [/forum/topic.php?fid=54&fpage=8&tid=2008596]: |
0ms |
get settings: |
10ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
32ms |
get topic data: |
10ms |
get forum data: |
3ms |
get page messages: |
33ms |
get tp. blocked users: |
2ms |
others: | 273ms |
total: | 381ms |
0 / 0 |