久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='EsB2N'><style id='EsB2N'><dir id='EsB2N'><q id='EsB2N'></q></dir></style></legend>
<i id='EsB2N'><tr id='EsB2N'><dt id='EsB2N'><q id='EsB2N'><span id='EsB2N'><b id='EsB2N'><form id='EsB2N'><ins id='EsB2N'></ins><ul id='EsB2N'></ul><sub id='EsB2N'></sub></form><legend id='EsB2N'></legend><bdo id='EsB2N'><pre id='EsB2N'><center id='EsB2N'></center></pre></bdo></b><th id='EsB2N'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EsB2N'><tfoot id='EsB2N'></tfoot><dl id='EsB2N'><fieldset id='EsB2N'></fieldset></dl></div>

    <tfoot id='EsB2N'></tfoot>

    <small id='EsB2N'></small><noframes id='EsB2N'>

        <bdo id='EsB2N'></bdo><ul id='EsB2N'></ul>
    1. 錯誤 1452:無法添加或更新子行:外鍵約束失敗

      ERROR 1452: Cannot add or update a child row: a foreign key constraint fails(錯誤 1452:無法添加或更新子行:外鍵約束失敗)
        <tbody id='bZXSo'></tbody>
    2. <legend id='bZXSo'><style id='bZXSo'><dir id='bZXSo'><q id='bZXSo'></q></dir></style></legend>

      <i id='bZXSo'><tr id='bZXSo'><dt id='bZXSo'><q id='bZXSo'><span id='bZXSo'><b id='bZXSo'><form id='bZXSo'><ins id='bZXSo'></ins><ul id='bZXSo'></ul><sub id='bZXSo'></sub></form><legend id='bZXSo'></legend><bdo id='bZXSo'><pre id='bZXSo'><center id='bZXSo'></center></pre></bdo></b><th id='bZXSo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bZXSo'><tfoot id='bZXSo'></tfoot><dl id='bZXSo'><fieldset id='bZXSo'></fieldset></dl></div>

            <bdo id='bZXSo'></bdo><ul id='bZXSo'></ul>
            • <tfoot id='bZXSo'></tfoot>
              • <small id='bZXSo'></small><noframes id='bZXSo'>

              • 本文介紹了錯誤 1452:無法添加或更新子行:外鍵約束失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我在 MySQL Workbench 中創(chuàng)建了表,如下所示:

                I have created tables in MySQL Workbench as shown below :

                ORDRE 表:

                CREATE TABLE Ordre (
                  OrdreID   INT NOT NULL,
                  OrdreDato DATE DEFAULT NULL,
                  KundeID   INT  DEFAULT NULL,
                  CONSTRAINT Ordre_pk PRIMARY KEY (OrdreID),
                  CONSTRAINT Ordre_fk FOREIGN KEY (KundeID) REFERENCES Kunde (KundeID)
                )
                  ENGINE = InnoDB;
                

                PRODUKT 表:

                CREATE TABLE Produkt (
                  ProduktID          INT NOT NULL,
                  ProduktBeskrivelse VARCHAR(100) DEFAULT NULL,
                  ProduktFarge       VARCHAR(20)  DEFAULT NULL,
                  Enhetpris          INT          DEFAULT NULL,
                  CONSTRAINT Produkt_pk PRIMARY KEY (ProduktID)
                )
                  ENGINE = InnoDB;
                

                ORDRELINJE表:

                CREATE TABLE Ordrelinje (
                  Ordre         INT NOT NULL,
                  Produkt       INT NOT NULL,
                  AntallBestilt INT DEFAULT NULL,
                  CONSTRAINT Ordrelinje_pk PRIMARY KEY (Ordre, Produkt),
                  CONSTRAINT Ordrelinje_fk FOREIGN KEY (Ordre) REFERENCES Ordre (OrdreID),
                  CONSTRAINT Ordrelinje_fk1 FOREIGN KEY (Produkt) REFERENCES Produkt (ProduktID)
                )
                  ENGINE = InnoDB;
                

                所以當(dāng)我嘗試將值插入 ORDRELINJE 表時,我得到:

                so when I try to insert values into ORDRELINJE table i get:

                錯誤代碼:1452.無法添加或更新子行:外鍵約束失敗(srdjank.Ordrelinje, CONSTRAINT Ordrelinje_fk FOREIGNKEY (Ordre) REFERENCES Ordre (OrdreID))

                Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails (srdjank.Ordrelinje, CONSTRAINT Ordrelinje_fk FOREIGN KEY (Ordre) REFERENCES Ordre (OrdreID))

                我看過關(guān)于這個主題的其他帖子,但沒有運氣.我是否在監(jiān)督某事或知道該怎么做?

                I've seen the other posts on this topic, but no luck. Am I overseeing something or any idea what to do?

                推薦答案

                摘自 使用外鍵約束

                外鍵關(guān)系涉及一個父表,其中包含中心數(shù)據(jù)值,以及具有相同值指向的子表回到它的父母.FOREIGN KEY 子句在子句中指定表.

                Foreign key relationships involve a parent table that holds the central data values, and a child table with identical values pointing back to its parent. The FOREIGN KEY clause is specified in the child table.

                它將拒絕任何試圖創(chuàng)建的 INSERT 或 UPDATE 操作如果沒有匹配項,則為子表中的外鍵值父表中的候選鍵值.

                It will reject any INSERT or UPDATE operation that attempts to create a foreign key value in a child table if there is no a matching candidate key value in the parent table.

                所以你的錯誤 Error Code: 1452. Cannot add or update a child row: a foreign key constraint failed 本質(zhì)上意味著,你正試圖向你的 Ordrelinje 添加一行Ordre 表中不存在匹配行 (OrderID) 的 code> 表.

                So your error Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails essentially means that, you are trying to add a row to your Ordrelinje table for which no matching row (OrderID) is present in Ordre table.

                您必須先將該行插入到您的 Ordre 表中.

                You must first insert the row to your Ordre table.

                這篇關(guān)于錯誤 1452:無法添加或更新子行:外鍵約束失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數(shù)根據(jù) N 個先前值來決定接下來的 N 個行)
                reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達(dá)式的結(jié)果;條款?)
                Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數(shù)的 ignore 選項是忽略整個事務(wù)還是只是有問題的行?) - IT屋-程序員軟件開發(fā)技
                Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環(huán)數(shù)組)
                pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調(diào)用 o23.load 時發(fā)生錯誤 沒有合適的驅(qū)動程序)
                How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數(shù)據(jù)庫表作為 Spark 數(shù)據(jù)幀讀取?)
                  <tfoot id='7CcFx'></tfoot>

                  <small id='7CcFx'></small><noframes id='7CcFx'>

                    <i id='7CcFx'><tr id='7CcFx'><dt id='7CcFx'><q id='7CcFx'><span id='7CcFx'><b id='7CcFx'><form id='7CcFx'><ins id='7CcFx'></ins><ul id='7CcFx'></ul><sub id='7CcFx'></sub></form><legend id='7CcFx'></legend><bdo id='7CcFx'><pre id='7CcFx'><center id='7CcFx'></center></pre></bdo></b><th id='7CcFx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7CcFx'><tfoot id='7CcFx'></tfoot><dl id='7CcFx'><fieldset id='7CcFx'></fieldset></dl></div>
                        <tbody id='7CcFx'></tbody>

                        <bdo id='7CcFx'></bdo><ul id='7CcFx'></ul>

                        <legend id='7CcFx'><style id='7CcFx'><dir id='7CcFx'><q id='7CcFx'></q></dir></style></legend>
                          主站蜘蛛池模板: 欧州一区二区三区 | 亚洲精品电影网在线观看 | 免费h在线 | 久久精品这里精品 | 先锋资源在线 | 久久久123| 国产精品久久久久久久久久久久午夜片 | av永久| 国产精品精品视频一区二区三区 | 久久首页 | 91精品导航 | 成人精品在线视频 | 免费黄色av网站 | 农夫在线精品视频免费观看 | 黄色一级特级片 | 欧美久久久久久久久 | 欧美在线小视频 | 久久99精品国产 | 亚洲午夜精品久久久久久app | 日韩爱爱网 | 国产精品久久免费观看 | 在线一区二区三区 | 国产专区在线 | 91免费在线看 | 伊人网站视频 | 欧美人妇做爰xxxⅹ性高电影 | 成人在线精品视频 | 三级av在线 | 国产av毛片| 色在线免费视频 | 偷拍自拍在线观看 | 国产精品久久久久久久毛片 | 免费久草| 午夜影院在线观看 | 成人在线免费电影 | 国产欧美精品在线观看 | 亚洲精品高清视频在线观看 | 精品欧美一区二区三区久久久 | 欧美伊人| 奇米影视首页 | 青春草91|