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

IF EXISTS

If the stored procedure does not exist and you specify IF EXISTS, NuoDB does not generate an error. Otherwise, if the stored procedure does not exist, an error is generated.

schema

Optional. The name of the schema that owns the stored procedure to be dropped. If schema is not provided, the stored procedure must be owned by the current schema.

sp_name

Name of the stored procedure to remove.

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"