15.00 - Function Name - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

Function Name

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.

 

IF a specific name …

THEN the name stored in DBC.TVM is its …

is not assigned to the function

function name.

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

is assigned to the function

specific function name.

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

See “Function Class Clause” on page 269.

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 (see “Function Overloading” on page 255). 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” on page 255 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” on page 274 for more information about function name usage.