TABLE_NAME scalar function
The TABLE_NAME function returns an unqualified name of the object found after any alias chains have been resolved.
The schema is SYSIBM.
The specified object-name (and object-schema) are used as the starting point of the resolution. If the starting point does not refer to an alias, the unqualified name of the starting point is returned. The resulting name may be of a table, view, or undefined object. In a Unicode database, if a supplied argument is a graphic string, it is first converted to a character string before the function is executed.
-
object-name
- A character expression representing the unqualified name (usually of an existing alias) to be resolved. object-name must have a data type of CHAR or VARCHAR and a length greater than 0 and less than 129 bytes. object-schema
- A character expression representing the schema used to qualify
the supplied object-name value before resolution. object-schema must
have a data type of CHAR or VARCHAR and a length greater than 0 and
less than 129 bytes.
If object-schema is not supplied, the default schema is used for the qualifier.
- table
- The value for object-name was either a table name (the input value is returned) or an alias name that resolved to the table whose name is returned.
- view
- The value for object-name was either a view name (the input value is returned) or an alias name that resolved to the view whose name is returned.
- undefined object
-
The value for object-name was either an undefined object (the input value is returned) or an alias name that resolved to the undefined object whose name is returned.
Therefore, if a non-null value is given to this function, a value is always returned, even if no object with the result name exists.
Notes
- To improve performance in partitioned database configurations by avoiding the unnecessary communication that occurs between the coordinator partition and catalog partition when using the TABLE_SCHEMA and TABLE_NAME scalar functions, the BASE_TABLE table function can be used instead.