Does anyone know what is the syntax for renaming a mysql stored procedure/function? Or is this even supported in MySQL? I've been googling this for several minutes...
To rename a stored procedureExpand Stored Procedures, right-click the procedure to rename, and then click Rename. Modify the procedure name. Modify the procedure name referenced in any dependent objects or scripts.
So you need to add a parameter and change the code in the stored procedure. Second, right-click the stored procedure that you want to change and select Alter Stored Procedure… MySQL Workbench will open a new tab that contains the definition of the stored procedure. Third, make the changes and click the Apply button.
To modify an existing stored routine (procedure or function), double-click the node of the routine to modify, or right-click this node and choose the Alter Routine command from the context menu. Either of the commands opens the SQL Editor. Routine properties can be viewed in the Properties window.
try this
UPDATE `mysql`.`proc`
SET name = '<new_proc_name>',
specific_name = '<new_proc_name>'
WHERE db = '<database>' AND
name = '<old_proc_name>';
Also note: If have granted privileges to users for this procedure you will need to update the procedure name in procs_priv as well.
UPDATE `mysql`.`procs_priv`
SET Routine_name = '<new_proc_name>'
WHERE Db = '<database>' AND
Routine_name = '<old_proc_name>';
FLUSH PRIVILEGES;
Source: MySQL Forums :: Newbie :: Rename Stored Procedure Syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With