我正在尝试在MySQL数据库中创建一个过程,但是我想检查它是否首先存在.
I am trying to create a procedure in a MySQL database, but I want to check if it exists first.
我知道如何对表执行此操作,但是当我对存储过程使用相同的语法时,它不会编译.
I know how to do it for a table but when I use the same syntax for a stored procedure it doesn't compile.
有人知道吗?
只需删除该过程(如果确实存在),然后重新添加即可:
Just drop the procedure if it does exist and then re-add it:
DROP PROCEDURE IF EXISTS my_procedure; CREATE PROCEDURE my_procedure()
这篇关于如何在MySQL中不存在的情况下创建过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程技术网(www.editcode.net)!