informix
Informix Guide to SQL: Syntax
SQL Statements

DROP FUNCTION

Use the DROP FUNCTION statement to remove a user-defined function from the database.

Syntax

Element Purpose Restrictions Syntax
function Name of the user-defined function to drop The function must exist (that is, be registered) in the database. If the name does not uniquely identify a function, you must enter one or more appropriate values for parameter_type. Database Object Name, p. 4-50
parameter_type Data type of the parameter The data type (or list of data types) must be the same types (and specified in the same order) as those specified in the CREATE FUNCTION statement when the function was created. Identifier, p. 4-205

Usage

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.

Examples

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:

Dropping SPL Functions

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 Information

Related statements: ALTER FUNCTION, CREATE FUNCTION, CREATE FUNCTION FROM, DROP FUNCTION, DROP ROUTINE, and EXECUTE FUNCTION


Informix Guide to SQL: Syntax, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved