DROP PROCEDURE statement

Use this statement to remove a procedure from the database.

Syntax
DROP PROCEDURE [ IF EXISTS ] [ owner.]procedure-name 
Remarks

Use the IF EXISTS clause if you do not want an error returned when the DROP PROCEDURE statement attempts to remove a procedure that does not exist.

You cannot execute a DROP PROCEDURE statement when the statement affects an object that is currently being used by another connection.

Permissions

Any user who owns the object, or has DBA authority, can execute the DROP PROCEDURE statement.

Side effects

Automatic commit. Clears the Results tab in the Results pane in Interactive SQL.

See also
Standards and compatibility
  • SQL/2003   Core feature.

Example

Drop MyProcedure from the database. If the procedure does not exist, an error is returned.

DROP PROCEDURE MyProcedure;