Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

DROP PROCEDURE

Use the DROP PROCEDURE statement to drop a user-defined procedure from the database. This statement is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DROP--------------------------------------------------------->
 
>--+-PROCEDURE--+-----------+--+-procedure-------+--+---------------------------------+-+-><
   |            '- owner--.-'  |  (1)            |  |           .-,--------------.    | |
   |                           '--------function-'  |  (2)      V                |    | |
   |                                                '--------(----parameter_type-+--)-' |
   |  (2)                                         (3)                                   |
   '--------SPECIFIC PROCEDURE--| Specific Name |---------------------------------------'
 
Notes:
  1. Stored Procedure Language only
  2. Dynamic Server only
  3. See Specific Name
Element Description Restrictions Syntax
function Name of a procedure or SPL function to drop Must exist (that is, be registered) in the database Identifier
owner Name of UDR owner Must own the procedure or SPL function Owner Name
parameter
_type
The data type of the parameter The data type (or list of data types) must be the same types (and in the same order) as those specified when the procedure was created Identifier; Data Type
procedure Name of user-defined procedure to drop Must exist (that is, be registered) in the database Database Object Name

Usage

Dropping a user-defined procedure removes the text and executable versions of the procedure. You cannot drop an SPL procedure within the same SPL procedure.

To use the DROP PROCEDURE statement, you must be the owner of the procedure or have the DBA privilege.

In Dynamic Server, for backward compatibility, you can use the DROP PROCEDURE statement to drop an SPL function that was created with the CREATE PROCEDURE statement.

In Extended Parallel Server, which does not support the DROP FUNCTION statement, use the DROP PROCEDURE statement to drop any SPL routine.

Extended Parallel Server does not support ALTER PROCEDURE, ALTER ROUTINE, or ALTER FUNCTION statements. To change the text of an SPL procedure, you must drop the procedure, modify it, and then re-create it. Make sure to keep a copy of the SPL procedure text somewhere outside the database, in case you need to re-create the procedure after it is dropped.

If the function or procedure name is not unique within the database, you must specify enough parameter_type information to disambiguate the name. If the database server cannot resolve an ambiguous UDR name whose signature differs from that of another UDR only in an unnamed ROW type parameter, an error is returned. (This error cannot be anticipated by the database server when the ambiguous function or procedure is defined.)

If you do not know whether a UDR is a user-defined procedure or a user-defined function, you can use the DROP ROUTINE statement. For more information, see DROP ROUTINE .

For backward compatibility, in Dynamic Server, you can use this statement to drop an SPL function that CREATE PROCEDURE created. You can include parameter data types after the name of the procedure to identify the procedure:

DROP PROCEDURE compare(int, int); 

In Dynamic Server, if you use the specific name for the user-defined procedure, you must also use the keyword SPECIFIC, as in the following example:

DROP SPECIFIC PROCEDURE compare_point; 
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]