The function name is the identifier used to call the SQL 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.
Though you can give an SQL function the same name as a column, you must be very careful to avoid specifying them ambiguously. For example, suppose text_find is the name of an SQL function and is also the name of a column in the sales table. If the column name is followed with a Teradata Database-style data type specification as in the following example, then the system assumes that text_find is a reference to the function named text_find, and not a reference to the identically named column text_find.
- 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:
In this example, sales is the table that contains the column named text_find.
You can precede the SQL 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 Name Overloading). If you overload function names, the parameter type specifications among the various overloaded function names must be sufficiently different to be distinguishable. See Function Name Overloading for a list of the rules the system uses to determine the uniqueness of a function by its parameters.