• <small id='kHK35'></small><noframes id='kHK35'>

      <tfoot id='kHK35'></tfoot>

          <bdo id='kHK35'></bdo><ul id='kHK35'></ul>
      1. <i id='kHK35'><tr id='kHK35'><dt id='kHK35'><q id='kHK35'><span id='kHK35'><b id='kHK35'><form id='kHK35'><ins id='kHK35'></ins><ul id='kHK35'></ul><sub id='kHK35'></sub></form><legend id='kHK35'></legend><bdo id='kHK35'><pre id='kHK35'><center id='kHK35'></center></pre></bdo></b><th id='kHK35'></th></span></q></dt></tr></i><div id='kHK35'><tfoot id='kHK35'></tfoot><dl id='kHK35'><fieldset id='kHK35'></fieldset></dl></div>

      2. <legend id='kHK35'><style id='kHK35'><dir id='kHK35'><q id='kHK35'></q></dir></style></legend>

        在带有参数的存储过程中插入 MYSQL 不起作用

        时间:2024-04-15
      3. <i id='MJvO6'><tr id='MJvO6'><dt id='MJvO6'><q id='MJvO6'><span id='MJvO6'><b id='MJvO6'><form id='MJvO6'><ins id='MJvO6'></ins><ul id='MJvO6'></ul><sub id='MJvO6'></sub></form><legend id='MJvO6'></legend><bdo id='MJvO6'><pre id='MJvO6'><center id='MJvO6'></center></pre></bdo></b><th id='MJvO6'></th></span></q></dt></tr></i><div id='MJvO6'><tfoot id='MJvO6'></tfoot><dl id='MJvO6'><fieldset id='MJvO6'></fieldset></dl></div>

        • <small id='MJvO6'></small><noframes id='MJvO6'>

              • <bdo id='MJvO6'></bdo><ul id='MJvO6'></ul>

                <legend id='MJvO6'><style id='MJvO6'><dir id='MJvO6'><q id='MJvO6'></q></dir></style></legend><tfoot id='MJvO6'></tfoot>

                    <tbody id='MJvO6'></tbody>
                1. 本文介绍了在带有参数的存储过程中插入 MYSQL 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 mysql 工作台创建一个带参数的存储过程,以将数据插入表中.

                  i am trying to make a stored procedure with parameters using mysql workbench to insert data into a table.

                  我做错了什么??

                      USE deb42181_ramos;
                  CREATE PROCEDURE sp_insertuser(IN gebruikersnaamparam varchar(10)
                  , IN wachtwoordparam VARCHAR(50)
                  , IN voornaamparam VARCHAR(15)
                  , IN achternaamparam VARCHAR(15)
                  , IN tussenvoegselparam VARCHAR(10)
                  , IN gebruikerlevelparam INT)
                  BEGIN
                  
                  INSERT INTO gebruikers (
                  gebruikersnaam
                  , wachtwoord
                  , voornaam
                  , achternaam
                  , tussenvoegsel
                  , gebruikerlevel)
                  
                      VALUES (gebruikersnaamparam
                      , wachtwoordparam
                      , voornaamparam
                      , achternaamparam
                      , tussenvoegselparam
                      , gebruikerlevelparam);
                  
                  END
                  

                  错误出现在值的最后一行 ) 他不希望有一个 ;
                  问候杰伦

                  the error is in the last row of the values after ) he doesnt expect a ;
                  regards Jeroen

                  推荐答案

                  你需要改变分隔符,像这样:

                  You need to change the delimiter, like this:

                  # change the delimiter to $$, so you can use semicolon in create procedure
                  DELIMITER $$
                  
                  USE deb42181_ramos$$
                  
                  DROP PROCEDURE IF EXISTS sp_insertuser$$
                  
                  CREATE PROCEDURE sp_insertuser(IN gebruikersnaamparam varchar(10)
                  , IN wachtwoordparam VARCHAR(50)
                  , IN voornaamparam VARCHAR(15)
                  , IN achternaamparam VARCHAR(15)
                  , IN tussenvoegselparam VARCHAR(10)
                  , IN gebruikerlevelparam INT)
                  BEGIN
                  
                  INSERT INTO gebruikers (
                  gebruikersnaam
                  , wachtwoord
                  , voornaam
                  , achternaam
                  , tussenvoegsel
                  , gebruikerlevel)
                  
                      VALUES (gebruikersnaamparam
                      , wachtwoordparam
                      , voornaamparam
                      , achternaamparam
                      , tussenvoegselparam
                      , gebruikerlevelparam);
                  
                  END$$
                  # change the delimiter back to semicolon
                  DELIMITER ;
                  

                  这篇关于在带有参数的存储过程中插入 MYSQL 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:用参数在mySql中创建一个过程 下一篇:向 SQL Server 中的存储过程添加参数的区别?

                  相关文章

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

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

                      <legend id='LSLkD'><style id='LSLkD'><dir id='LSLkD'><q id='LSLkD'></q></dir></style></legend>