16.20 - Function Name - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Detailed Topics

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1184-162K
Language
English (United States)

The function name is the identifier used to call the function from an SQL request. It is not necessarily the database object name that is stored in DBC.TVM.

Specific Name Name Stored in DBC.TVM
Not assigned to the function Function name.

In this case, the function name must be unique within its database.

Assigned to the function Specific function name.

In this case, the function name need not be unique within its database.

See Function Class Clause.

Though you can give a function the same name as a column, you must be very careful to avoid specifying them ambiguously. For example, if the column name is followed with a Teradata Database-style type clause as in the following example, then the system assumes that text_find is a reference to the function named text_find, not a reference to the identically named column text_find:

text_find(FLOAT),
There are two ways to make your request unambiguous:
  • Use the ANSI syntax for CAST to make an explicit declaration of data type rather than a function parameter. For example,
    CAST (text_find as FLOAT)
  • Qualify the column name fully. For example,
    sales.text_find (FLOAT)

    In this example, sales is the table that contains the column named text_find.

You can precede the function name with its containing database or user name if the function is created in a different database or user than your default. The scope of the name is the database or user in which it is contained.

A function name need not be unique: several functions can have the same function name. This is referred to as function name overloading. If you overload function names, the parameter type specifications among the various overloaded function names must be sufficiently different to be distinguishable or you must use the TD_ANYTYPE parameter data type. You cannot overload the names of functions written to enforce row-level security.

See Function Overloading for a list of the rules the system uses to determine the uniqueness of a function by its parameters. See the table in External Body Reference Clause for more information about function name usage.