TABLE_NAME

The TABLE_NAME function returns an unqualified name of the object found for an alias.

TABLE_NAME(object-name,object-schema)

The specified object-name (and object-schema) are used to find an alias by that name.

object-name
A character or graphic string expression that identifies the SQL or system name of the object to be resolved. object-name must have an actual length less than 129 characters and may not identify a blank name. This name is case sensitive and must not be delimited.
object-schema
A character or graphic string expression that identifies the SQL or system name of the schema used to qualify object-name. object-schema must have an actual length less than 129 characters and may not identify a blank name. This name is case sensitive and must not be delimited.

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

The result of the function is VARCHAR(128). If object-name can be null, the result can be null; if object-name is null, the result is the null value. If object-schema is the null value, the default schema name is used. The result is the character string representing an unqualifed name.

The result name is the table name or view name referenced by the alias. If object-name is not an alias name, object-name is returned.

Start of change

Example

Get the name of the table referenced by an alias that was created like this:
CREATE ALIAS MYLIB2.ALIAS1 FOR MYLIB.EMPLOYEE


VALUES TABLE_NAME('ALIAS1', 'MYLIB2')
The result is:
EMPLOYEE
End of change