DROP FUNCTION

Documentation

VoltDB Home » Documentation » Using VoltDB

DROP FUNCTION

DROP FUNCTION — Removes the definition of a SQL function.

Synopsis

DROP FUNCTION function-name [IF EXISTS]

Description

The DROP FUNCTION statement deletes the definition of the specified user-defined function. Note that, for functions declared using CREATE FUNCTION and a class file, the statement does not delete the class that implements the function, it only deletes the definition. To remove the Java class that contains the associated function method, you must first drop the function definition then use the sqlcmd remove classes directive to remove the class.

The IF EXISTS clause allows the statement to succeed even if the specified function name does not exist. If the function does not exist and you do not include the IF EXISTS clause, the statement will return an error.

Examples

The following example removes the definitions of the HTML_ENCODE and HTML_DECODE functions, then uses remove classes to remove the class containing their corresponding methods.

$ sqlcmd
1> DROP FUNCTION html_encode;
1> DROP FUNCTION html_decode;
2> remove classes "*.HtmlFunctions";