DROP PROCEDURE

DROP PROCEDURE — remove a stored procedure

Syntax

DROP PROCEDURE [schema.]sp_name [ IF EXISTS ]
DROP PROCEDURE [ IF EXISTS ] [schema.]sp_name

Description

DROP PROCEDURE removes the definition of an existing stored procedure. If schema_name is not specified, an attempt will be made to drop a stored procedure with the specified sp_name from the current schema. To execute this command the user must be the owner of the stored procedure. See CREATE PROCEDURE to create a stored procedure.

Parameters

Example

Create a stored procedure. Drop the stored procedure

USE USER
SET DELIMITER @
CREATE PROCEDURE prc_boolean1() 
         RETURNS tmp_table1 (column1 BOOLEAN) 
AS 
         INSERT INTO tmp_table1 VALUES (True), (False), (Unknown), (Null); 
END_PROCEDURE
@
SET DELIMITER ;
 
EXECUTE prc_boolean1();
 COLUMN1  
 -------
 TRUE  
 FALSE 
 <null>
 <null> 
 
DROP PROCEDURE prc_boolean1;
EXECUTE prc_boolean1();
can't find procedure "USER.PRC_BOOLEAN1"