DROP PROCEDURE and DROP FUNCTION Syntax


This statement is used to drop a stored procedure or function. That is, the specified routine is removed from the server. You must have the ALTER ROUTINE privilege for the routine. (If the automatic_sp_privileges system variable is enabled, that privilege and EXECUTE are granted automatically to the routine creator when the routine is created and dropped from the creator when the routine is dropped. See , "Stored Routines and MariaDB Privileges".)

The IF EXISTS clause is a MariaDB extension. It prevents an error from occurring if the procedure or function does not exist. A warning is produced that can be viewed with SHOW WARNINGS.

DROP FUNCTION is also used to drop user-defined functions (see , "DROP FUNCTION Syntax").

Retornar