SQL Reference

TABLE_NAME

>>-TABLE_NAME---(--objectname--+------------------+---)--------><
                               '-,--objectschema--'
 

The schema is SYSIBM.

The TABLE_NAME function returns an unqualified name of the object found after any alias chains have been resolved. The specified objectname (and objectschema) 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.

objectname
A character expression representing the unqualified name (usually of an existing alias) to be resolved. objectname must have a data type of CHAR or VARCHAR and a length greater than 0 and less than 129 characters.

objectschema
A character expression representing the schema used to qualify the supplied objectname value before resolution. objectschema must have a data type of CHAR or VARCHAR and a length greater than 0 and less than 129 characters.

If objectschema is not supplied, the default schema is used for the qualifier.

The data type of the result of the function is VARCHAR(128). If objectname can be null, the result can be null; if objectname is null, the result is the null value. If objectschema is the null value, the default schema name is used. The result is the character string representing an unqualified name. The result name could represent one of the following:

table
The value for objectname 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 objectname 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 objectname 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.

Examples:

See the Examples section in TABLE_SCHEMA.


[ Top of Page | Previous Page | Next Page ]