久久久久久久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 觸發(fā)器中中止 INSERT 操作?

        How to abort INSERT operation in MySql trigger?(如何在 MySql 觸發(fā)器中中止 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 觸發(fā)器中中止 INSERT 操作?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

                  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...).

                  我考慮過使用觸發(fā)器來執(zhí)行此操作,但是如果觸發(fā)器發(fā)現(xiàn)插入即將插入重復(fù)條目,我該如何拋出異常/引發(fā)錯誤?我想我想像 MySql 那樣拋出一個 MySqlException 并使用重復(fù)的主鍵等,這樣我就可以在我的 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.

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

                  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?

                  觸發(fā)代碼如下:

                  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 文檔中關(guān)于觸發(fā)器的評論 表明 mysql 中沒有這樣的功能.您能做的最好的事情是為您的觸發(fā)器錯誤創(chuàng)建一個單獨的表,如同一頁面上的建議.

                  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.

                  這篇關(guān)于如何在 MySql 觸發(fā)器中中止 INSERT 操作?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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中重用選擇表達式的結(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ù)幀讀取?)
                    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>

                            主站蜘蛛池模板: 久久亚洲一区二区三区四区 | 男女污污动态图 | 精品伦精品一区二区三区视频 | 欧美精品一二三 | 成人在线视频观看 | 性色av网站 | 玖玖视频免费 | 欧美乱大交xxxxx另类电影 | 91毛片在线观看 | 日韩一区不卡 | av在线免费不卡 | 国产精品欧美一区二区三区 | 成人福利在线 | 亚洲成av人影片在线观看 | 性高朝久久久久久久3小时 av一区二区三区四区 | 粉嫩粉嫩芽的虎白女18在线视频 | 精品国产一区二区三区av片 | 亚洲精品久久久蜜桃 | 婷婷狠狠 | 涩爱av一区二区三区 | 黄一区二区三区 | 国产一区二区黑人欧美xxxx | 午夜免费在线观看 | 91国产在线视频在线 | 一级特黄网站 | 九九av| 国产内谢 | 伊人网91 | 国产中文在线观看 | 欧美色综合网 | 国产亚洲人成a在线v网站 | 亚洲欧美中文日韩在线v日本 | 毛片视频网站 | 亚洲欧美在线视频 | 日本三级在线网站 | 亚洲欧美激情精品一区二区 | 91电影 | 日本不卡一区二区三区在线观看 | 欧美a在线看 | 久久久久久久国产精品影院 | 一区精品视频在线观看 |