Unqualified Object Names - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

An unqualified object name is a reference to an object such as a table, column, trigger, macro, or stored procedure that does not include parent objects. For example, the WHERE clause in the following statement uses “DeptNo” as an unqualified column name:

SELECT *
FROM Personnel.Employee
WHERE DeptNo = 100 ;

Unqualified Column Names

You can omit database and table name qualifiers when you reference columns if the reference is not ambiguous.

For example, the WHERE clause in the following statement:

SELECT Name, DeptNo, JobTitle
FROM Personnel.Employee
WHERE Personnel.Employee.DeptNo = 100 ;

can be written as:

WHERE DeptNo = 100 ;

because the database name and table name can be derived from the Personnel.Employee reference in the FROM clause.

Omitting Database Names

When you omit the database name qualifier, Vantage looks in the following databases to find the unqualified object name:
  • The default database
  • Other databases, if any, referenced by the SQL statement
  • The logon user database for a volatile table, if the unqualified object name is a table name
  • The SYSLIB database, if the unqualified object name is a C or C++ UDF that is not in the default database

The search must find the name in only one of those databases. An ambiguous name error message results if the name exists in more than one of those databases.

For example, if your logon user database has no volatile tables named Employee and you have established Personnel as your default database, you can omit the Personnel database name qualifier from the preceding sample query.