如何在MySQL中编辑存储过程?

时间:2021-09-24 02:01:47

I can't seem to find the syntax for editing an already-created stored procedure in MySQL.

我似乎无法找到在MySQL中编辑已创建的存储过程的语法。

2 个解决方案

#1


22  

You can change certain attributes using the ALTER PROCEDURE syntax

您可以使用ALTER PROCEDURE语法更改某些属性

To change the procedure body you will have to drop and recreate the entire procedure, in this case SHOW CREATE PROCEDURE may be useful

要更改过程体,您必须删除并重新创建整个过程,在这种情况下,SHOW CREATE PROCEDURE可能很有用

#2


19  

Mysql do not allow to alter stored procedure but SP can be drop and recreate SP options are available in Mysql like below query

Mysql不允许更改存储过程,但SP可以删除并重新创建SP选项在Mysql中可用,如下面的查询

DROP PROCEDURE IF EXISTS foo;
    delimiter //
    create PROCEDURE foo (args)
    begin
      bla bla
    end//
    delimiter ;

#1


22  

You can change certain attributes using the ALTER PROCEDURE syntax

您可以使用ALTER PROCEDURE语法更改某些属性

To change the procedure body you will have to drop and recreate the entire procedure, in this case SHOW CREATE PROCEDURE may be useful

要更改过程体,您必须删除并重新创建整个过程,在这种情况下,SHOW CREATE PROCEDURE可能很有用

#2


19  

Mysql do not allow to alter stored procedure but SP can be drop and recreate SP options are available in Mysql like below query

Mysql不允许更改存储过程,但SP可以删除并重新创建SP选项在Mysql中可用,如下面的查询

DROP PROCEDURE IF EXISTS foo;
    delimiter //
    create PROCEDURE foo (args)
    begin
      bla bla
    end//
    delimiter ;