Drops an existing user-defined function. The function's name and its list of arguments (as specified when the function was created using the CREATE FUNCTION statement) should be provided for identifying the function. Only the function owner can execute this statement.
ImportantDROP FUNCTION cannot be undone. Use it with care!
Functions display only if the current has USAGE privileges on them.
Arguments
function_name
The name of the function to drop. If the name is case sensitive you must wrap it in double quotes; otherwise the system uses the lower case name.
(arg_name arg_type [,…])
An ordered list of function argument names and types.
Example
Drop a function
Assume a user-defined function, named touppercase, is created using the CREATE FUNCTION statement and is now available:
db1.public/my_store#CREATEFUNCTIONtoUpperCase (s VARCHAR) RETURNS VARCHAR LANGUAGE JAVA WITH ('source.name'='mysrc','class.name'='util.UpperCase');+------------+-------------+------------+------------------------------------------+|Type|Name|Command|Summary|+============+=============+============+==========================================+|function| touppercase |CREATE|functiontouppercase was successfully |||||created|+------------+-------------+------------+------------------------------------------+
You can drop this function with the below statement:
db1.public/my_store#SHOWFUNCTIONS;+--------------------------------+-------+--------------+----------------+--------------------+------------+-------------+-------------------------------+-------------------------------+|Signature|Type|SourceName|ClassName|EgressAllowURIs|Owner|Properties|CreatedAt|UpdatedAt|+================================+=======+==============+================+====================+============+=============+===============================+===============================+|touppercase(sVARCHAR) VARCHAR |udf|functions|util.UpperCase||sysadmin| {} |2024-07-0222:25:20+0000UTC|2024-07-0222:25:20+0000UTC|+--------------------------------+-------+--------------+----------------+--------------------+------------+-------------+-------------------------------+-------------------------------+db1.public/my_store#DROPFUNCTIONtoUpperCase (s VARCHAR);+------------+-------------+------------+---------------------------------------+|Type|Name|Command|Summary|+============+=============+============+=======================================+|function| touppercase |DROP|functiontouppercase has been deleted |+------------+-------------+------------+---------------------------------------+