В чем ошибка SQL запроса?


На такой запрос:
INSERT INTO `mcc_article` VALUES (null,'2005-09-18 13:45:04','EN','alcibiade','tips','You can find new opponents in the rankings page.','');
INSERT INTO `mcc_article` VALUES (null,'2005-09-18 13:45:04','EN','alcibiade','tips','During a game, you can offer a draw to your opponent by enabling the checkbox \'Offer Draw\'. On his next move, your opponent will be able to accept your offer or keep on playing.','');
INSERT INTO `mcc_article` VALUES (null,'2005-09-18 13:45:04','EN','alcibiade','tips','If someone opened a game that\nyou don\'t want to play, you can delete it.<br />\nTo do so, simply enter <strong>DELETE</strong> instead\nof your first move.<br />\nThis is only possible before you play your first move.<br />\nScores will keep unchanged.','');
INSERT INTO `mcc_article` VALUES (null,'2005-09-18 13:45:04','EN','alcibiade','tips','If you find yourself in a position that you think\nis desperate, you can let the game to your\n opponent by entering \'resign\' as a move.','');
INSERT INTO `mcc_article` VALUES (null,'2005-09-18 13:45:04','EN','alcibiade','tips','You can gain more points by winning\ngames against players having more points than you.','');
INSERT INTO `mcc_article` VALUES (null,'2005-09-18 13:45:04','EN','alcibiade','tips','If you encounter any problem, or have any question,\ndon\'t hesitate to contact us by mail using the link below.<br />\nYou can also send us your features requests.','');
INSERT INTO `mcc_article` VALUES (null,'2005-09-18 13:45:04','EN','alcibiade','tips','GnuChess and Phalanx are chess engines you can play against.\nThey play twice an hour and their number represent their\nreflection depth.','');
INSERT INTO `mcc_article` VALUES (null,'2005-09-18 13:45:04','EN','alcibiade','tips','Using the search feature you can find and view any game played\non the server. The archives contains all finished games.','');
INSERT INTO `mcc_article` VALUES (null,'2005-09-24 11:47:00','EN','alcibiade','tips','Use the notes box to keep track of your ideas. It is really useful\nwhen playing simultaneous games.<br />\nIt is confidential since you\'re the only one able to read them.',NULL);
INSERT INTO `mcc_article` VALUES (null,'2005-11-28 23:12:00','EN','alcibiade','tips','You can change your email notification address if necessary.<br />\nGo to <cite>Your Profile / Change Your Email Settings</cite>.<br />\nBy doing so, you can also select the desired time lapse before being\nnotified when it\'s your turn to play.\n',NULL);
INSERT INTO `mcc_article` VALUES (null,'2006-04-05 00:00:00','EN','alcibiade','tips','You can follow the progress of your invitations and know if your\nfriends opened the message you sent or not.<br />\nAlternatively, you\'ll be able to resend your invitation.',NULL);
INSERT INTO `mcc_article` VALUES (null,'2006-04-05 00:00:00','EN','alcibiade','tips','Click on the link <cite>Invite a friend</cite> in the top menu\nto send invitations to your friends.',NULL);

Выдается такой ответ:
INSERT INTO `mcc_article`
NULL , '2005-09-18 13:45:04', 'EN', 'alcibiade', 'tips', 'You can find new opponents in the rankings page.', ''

Ответ MySQL: Документация
#1452 - Cannot add or update a child row: a foreign key constraint fails (`chess`.`mcc_article`, CONSTRAINT `mcc_article_ibfk_1` FOREIGN KEY (`art_author`) REFERENCES `mcc_player` (`pl_identifier`))

В чем ошибка?
  • Вопрос задан
  • 2595 просмотров
Решения вопроса 1
нарушение целостности при проверке по внешнему ключу
Ответ написан
Пригласить эксперта
Ответы на вопрос 2
Любые ответы на любые вопросы
Поработаю гугл-транслейтом - вам написали "запись с ключом robot_gnuchess_01 дублируется, чего не допускает первичный ключ."

Разбирайтесь, откуда у вас дубль и что с ним делать.
Ответ написан
Ссылку про нарушение целостности Вам уже скинули, это оно и есть.
В качестве возможного решения - замените INSERT на REPLACE(документация). Поможет с вероятностью 50 на 50.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы