Rename part of the parameter names of a precedent

Asked

Viewed 31 times

0

I have some procedures where parameter names start with: "p_". It is possible to change in a unique way and via code all the names of all the procedures that start with this abbreviation by: "abc_" for example?

Procedure:

CREATE DEFINER = 'root'@'%' PROCEDURE `postSac`(
        IN p_nome VARCHAR(255),
        IN p_telefone VARCHAR(15),
        IN p_email VARCHAR(100),
        IN p_cidade VARCHAR(100),
        IN p_estado VARCHAR(2),
        IN p_assunto VARCHAR(255),
        IN p_mensagem LONGTEXT
    )
    NOT DETERMINISTIC
    CONTAINS SQL
    SQL SECURITY DEFINER
    COMMENT ''
BEGIN

   DECLARE EXIT HANDLER FOR SQLEXCEPTION
      BEGIN
         SHOW WARNINGS;
         #SELECT 0 AS retorno;
         ROLLBACK;
      END;
   START TRANSACTION;

   INSERT INTO sac (nome, telefone, email, cidade, estado, assunto, mensagem) VALUES (p_nome, p_telefone, p_email, p_cidade, p_estado, p_assunto, p_mensagem);

END;

1 answer

0

Unfortunately I ended up discovering that this is not possible:

This statement can be used to change the characteristics of a stored procedure. More than one change can be specified in an ALTER Procedurestatement. However, you cannot change the parameters or the body of a stored procedure using this statement; To make these changes, you must release and recreate the procedure using DROP Proceduree CREATE PROCEDURE.

https://dev.mysql.com/doc/refman/5.7/en/alter-procedure.html

Browser other questions tagged

You are not signed in. Login or sign up in order to post.