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

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

  • <legend id='OKwBU'><style id='OKwBU'><dir id='OKwBU'><q id='OKwBU'></q></dir></style></legend>

      <bdo id='OKwBU'></bdo><ul id='OKwBU'></ul>
    1. <tfoot id='OKwBU'></tfoot>

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

        如何在 MySql 觸發器中中止 INSERT 操作?

        How to abort INSERT operation in MySql trigger?(如何在 MySql 觸發器中中止 INSERT 操作?)
              <tbody id='6X8p2'></tbody>
          1. <small id='6X8p2'></small><noframes id='6X8p2'>

              • <bdo id='6X8p2'></bdo><ul id='6X8p2'></ul>
                  <i id='6X8p2'><tr id='6X8p2'><dt id='6X8p2'><q id='6X8p2'><span id='6X8p2'><b id='6X8p2'><form id='6X8p2'><ins id='6X8p2'></ins><ul id='6X8p2'></ul><sub id='6X8p2'></sub></form><legend id='6X8p2'></legend><bdo id='6X8p2'><pre id='6X8p2'><center id='6X8p2'></center></pre></bdo></b><th id='6X8p2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6X8p2'><tfoot id='6X8p2'></tfoot><dl id='6X8p2'><fieldset id='6X8p2'></fieldset></dl></div>
                  <legend id='6X8p2'><style id='6X8p2'><dir id='6X8p2'><q id='6X8p2'></q></dir></style></legend>
                  <tfoot id='6X8p2'></tfoot>
                  本文介紹了如何在 MySql 觸發器中中止 INSERT 操作?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個表,其中包含一個 url 和一個表示其參數的字符串.問題是我想要一個 url 和一個參數字符串作為表的唯一約束 - 也就是沒有條目可以具有相同的 url AND 參數字符串.參數字符串可以是任意長度(大于 800 字節左右,這是 MySql 鍵的最大長度,所以我不能使用 Unique(url, params) 因為它會引發錯誤......).

                  I have a table containing an url and a string representing its parameters. The problem is I want an url and a parameterstring to be the unique constraint for the table - aka no entries can have the same url AND parameter string. The parameter string can be of arbitrary length (longer than 800bytes or so which is the max length for a MySql key, so I cant use Unique(url, params) since it throws an error...).

                  我考慮過使用觸發器來執行此操作,但是如果觸發器發現插入即將插入重復條目,我該如何拋出異常/引發錯誤?我想我想像 MySql 那樣拋出一個 MySqlException 并使用重復的主鍵等,這樣我就可以在我的 C# 代碼中捕獲它.

                  I thought about using triggers to do this, but how do I throw an exception/raise an error if the trigger discovers the insert is about to insert a duplicate entry? I imagine I would like to have a MySqlException thrown like MySql does with duplicate primary keys etc so I can catch it in my C# code.

                  我的觸發器中有兩部分需要幫助:... 中止向 C# 拋出異常 ... 如何向 C# 拋出異常等?... 允許插入 ... - 如果沒有重復條目,我如何只允許插入?

                  I have two pieces in the trigger I need to get help with: ... Abort throw exception to C# ... How do I throw an exception etc to C#? ... Allow insert ... - how do I just allow the insert if there is no duplicate entry?

                  觸發代碼如下:

                  CREATE TRIGGER urls_check_duplicates
                  BEFORE INSERT ON urls
                  FOR EACH ROW
                  
                  BEGIN
                  DECLARE num_rows INTEGER;
                  
                  SELECT COUNT(*)
                  INTO num_rows
                  FROM urls
                  WHERE url = NEW.url AND params = NEW.params;
                  
                  IF num_rows > 0 THEN
                     ... ABORT/throw exception to C# ...
                  ELSE
                     ... Allow insert ...
                  END
                  

                  推薦答案

                  mysql 文檔中關于觸發器的評論 表明 mysql 中沒有這樣的功能.您能做的最好的事情是為您的觸發器錯誤創建一個單獨的表,如同一頁面上的建議.

                  The comments in the mysql documentation about triggers suggest that there is no such feature in mysql. The best you can do is to create a separate table for your trigger errors, as suggested on the same page.

                  這篇關于如何在 MySql 觸發器中中止 INSERT 操作?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

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

                          <bdo id='M7Lk5'></bdo><ul id='M7Lk5'></ul>

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

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

                            主站蜘蛛池模板: 亚洲三级国产 | 99精品国自产在线 | 少妇性l交大片免费一 | 久久综合久| 91精品国产综合久久婷婷香蕉 | 青青99| 免费视频成人国产精品网站 | 三级成人片 | 男插女下体视频 | 欧美aa在线 | 久久激情网 | 国产一级在线观看 | 三a毛片 | 波多野结衣精品在线 | 日本视频中文字幕 | 日韩在线播放中文字幕 | 国产午夜精品久久久久 | 欧美色综合一区二区三区 | 午夜99| 久久精品久久综合 | 成人超碰 | 一区二区三区四区五区在线视频 | 精品国产乱码久久久久久闺蜜 | 欧美激情国产日韩精品一区18 | a视频在线观看 | 久久国产精品-国产精品 | 国户精品久久久久久久久久久不卡 | 97精品国产手机 | 久久久久久久电影 | 亚洲成人自拍 | 久久精品91久久久久久再现 | 日本精品久久 | 亚洲一区网站 | 亚洲狠狠| 久久首页 | 中文字幕91av| 欧美日韩久 | 三级成人在线 | 国产一区 | 97影院2| 日日天天 |