16.20 - FUNCTION - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Content Type
Programming Reference
Publication ID
B035-1144-162K
Language
English (United States)
Last Update
2019-05-24
function_name
Function name for the external or SQL function to drop.
database_name
Name of the containing database for function_name, if different from the current database.
user_name
Name of the containing user for function_name, if different from the current user.
data_type
Optional data type specification for the parameters passed to function_name.
If you do not specify a data type list, then the specified function must be the only one with that name in the database.
Only the data types associated with the function parameters need be specified.
The length specification for a string is not relevant, but you can specify it. Likewise, neither the length for DECIMAL, TIME, TIMESTAMP, and INTERVAL types nor the decimal placement for the DECIMAL type is relevant, but you can specify it.

Example: Dropping an External Function and Unique Function Names

You can drop a function definition using either its function name or its specific function name. The example also shows that if the name cannot be resolved to a unique object using the DROP FUNCTION statement you specify, you cannot drop it.

Consider the following function definition.

     CREATE FUNCTION test_image(VARCHAR(5000), INTEGER) …
       SPECIFIC testi_opt1 …;
     CREATE FUNCTION test_image(VARCHAR(5000), FLOAT)…
       SPECIFIC testi_opt2 …;

The following DROP FUNCTION requests both drop this function.

     DROP SPECIFIC FUNCTION testi_opt1;
     DROP FUNCTION test_image(VARCHAR, INTEGER);

The following statement returns an error because there is not an instance of a function named test_image without parameters.

     DROP FUNCTION test_image();