15.10 - FUNCTION - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

The following character string is the function name for the external or SQL function to be dropped.

function_name
Function name for the external or SQL function to be dropped.
database_name
user_name
Name of the containing database or user for function_name if different from the current database or user.
data_type
Optional data type specification for the parameters passed to function_name. See Data Types Syntax.
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

Like Example: Dropping an External Function by Function Name or Specific Function Name, this example demonstrates that 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 request fails because there is no instance of a function named test_image that has no parameters.

     DROP FUNCTION test_image();