When Fully Qualified Names Are Required - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
imq1591724555718.ditamap
dita:ditavalPath
imq1591724555718.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

Using unqualified names is easiest when the default database is the only database referred to by an SQL statement. When an SQL statement references tables, views, or other objects from more than one database, unqualified names can apply to only one of those databases.

When encountering an unqualified table name, the system looks for an object by that name in all of the following databases:
  • The default database.
  • Any databases referenced by the SQL statement.
  • The login user database for a volatile table by that name.

The search must find the table name in only one of those databases. The system returns the “ambiguous table name” error message if the table name exists in more than one of those databases. The default database does not receive priority over any other database.

Therefore, if you reference more than one database, you must use the fully qualified form for names that are contained in more than one of the databases.

The following syntax shows the fully-qualified form referencing, for example, a table:

database_name.table_name