Use the function name to call the function from an SQL request. The function name is not necessarily the database object name stored in DBC.TVM.
| Specific Name | Name Stored in DBC.TVM |
|---|---|
| Not assigned to the function | Function name. The function name must be unique within its database. |
| Assigned to the function | Specific function name. The function name need not be unique within its database. See "Function Class Clause" in Using Clauses: CREATE FUNCTION and REPLACE FUNCTION (External Form). |
You can give a function the same name as a column, but avoid ambiguity. For example, if the column name is followed with a 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),
- 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.
The scope of the function name is the database or user that contains it. If the function is in a different database or user than your default, you can precede the function name with its containing database or user name.
Multiple functions can have the same function name. This is called function name overloading. If you overload function names, the parameter type specifications among the 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 the table in "External Body Reference Clause" in External Data Access Clause: CREATE FUNCTION and REPLACE FUNCTION (External Form) for more information about function name usage.