Delete a user-defined procedure or function.


<drop routine statement> ::=

DROP <routine type> [ IF EXISTS ] [ schema-name. ] routine-name [ RESTRICT ]

<routine type> ::=







The DROP ROUTINE statement deletes the procedure or function specified by routine-name from the database.


The current database is implicit if a schema name is not specified.
ROUTINE can be specified to indicate that the routine type can be either procedure or function.
If PROCEDURE or FUNCTION is specified, then the routine being deleted must be the specified type.
The IF EXISTS clause can be specified to avoid an exception when attempting to delete a routine that does not exist in the database.
RESTRICT, which is implicit if not explicitly specified, prevents the routine from being deleted if the routine is referenced by other database objects.
The DROP ROUTINE statement requires exclusive access to the routine being deleted.


1) The following example deletes the getStudents function:

       DROP FUNCTION IF EXISTS getStudents

2) The following example deletes the getStudents function using the ROUTINE keyword:

       DROP ROUTINE IF EXISTS getStudents

3) The following example deletes the studentNames procedure:

       DROP PROCEDURE IF EXISTS studentNames


SQL:2003 standard

NexusDB extensions



Core SQL

IF EXISTS clause

Home | Site Contents | Documentation | NexusDB Manual V4 | SQL Reference | SQL Statements | Schema Statements