![]() |
|
Use the DROP FUNCTION statement to remove a user-defined function from the database.
Dropping a user-defined function removes the text and executable versions of the function from the database.
If you do not know if a UDR is a user-defined function or a user-defined procedure, you can drop the UDR by using the DROP ROUTINE statement.
To use the DROP FUNCTION statement, you must be the owner of the user-defined function or have the DBA privilege.
If you use parameter data types to identify a user-defined function, they follow the function name, as in the following example:
If you use the specific name for the user-defined function, you must use the keyword SPECIFIC, as in the following example:
Because you cannot change the text of an SPL function, you must drop it and then re-create it. Make sure that you have a copy of the SPL function text somewhere outside the database, in case you want to re-create it after it is dropped.
You cannot drop an SPL function from within the same SPL function.
Related statements: ALTER FUNCTION, CREATE FUNCTION, CREATE FUNCTION FROM, DROP FUNCTION, DROP ROUTINE, and EXECUTE FUNCTION