TABLE_SCHEMA
The TABLE_SCHEMA function searches for an object and returns the schema name of the object after any synonyms or alias chains have been resolved.
The schema is DSN8.
The starting point of the resolution is the object that is specified by objectname and objectschema. If the starting point does not refer to an alias or synonym, the schema name of the starting point is returned. The resulting schema name can be of a table, view, or undefined object.
- object-name
- A character expression that specifies the unqualified name to be resolved. The unqualified name is usually of an existing alias. object-name must have a data type of VARCHAR and an actual length that is no greater than 18 bytes.
- object-schema
- A character expression that represents the schema that is used
to qualify the value specified in object-name before
resolution. object-schema must have a data
type of VARCHAR and an actual length that is no greater than 8 bytes.
If object-schema is not specified or is null, the default schema is used for the qualifier.
- location-name
- A character expression that represents the location that is used
to qualify the value specified in object-name before
resolution. location-name must have a data
type of VARCHAR (and an actual length that is no greater than 16 bytes.
If location-name is not specified or is null, the location name is equivalent to
any
.
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.
Input arguments | External name | Specific name |
---|---|---|
object-name (VARCHAR)
|
DSN8DUTI | DSN8.DSN8DUTISV |
object-name (VARCHAR)
object-schema (VARCHAR) |
DSN8DUTI | DSN8.DSN8DUTISVV |
object-name (VARCHAR)
object-schema (VARCHAR) location-name (VARCHAR) |
DSN8DUTI | DSN8.DSN8DUTISVVV |
Example: Assume that:
- DSN8.ALIAS_OF_SYSTABLES is an alias of SYSIBM.SYSTABLES.
- The CURRENT SQLID is DSN8.
VALUES DSN8.TABLE_SCHEMA( 'ALIAS_OF_SYSTABLES' );
The
result of the function is 'SYSIBM
'.