Dropping procedure which already exists? [duplicate]

匿名 (未验证) 提交于 2019-12-03 02:29:01

问题:

Possible Duplicate:
Error with mysql procedures ERROR 1304 & ERROR 1305

I try to run a command to drop a procedure:

DROP PROCEDURE create_datetable 

By doing this I get the a warning:

1304 PROCEDURE create_datetable already exists 

After that when I'm trying to create a new procedure with the same name, I get the same warning.

What does this mean?

回答1:

Reference: Drop Procedure.

The code:

DROP PROCEDURE IF EXISTS procedureName; ... 

Edit:

Can you try to rename the procedure and then try to drop it as per this post: Rename a mysql procedure?

try this:

UPDATE `mysql`.`create_DataTable` 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 newProcedure as well.

UPDATE `mysql`.`create_DataTable` SET Routine_name = '<new_proc_name>' WHERE Db = '<database>' AND   Routine_name = '<old_proc_name>';  FLUSH PRIVILEGES; 

Do you have the freedom to delete all procedures? If so please try out this post: Drop all stored procedures in MySQL or using temporary stored procedures and post2: Drop all stored procedures in MySQL or using temporary stored procedures.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!