DROP TABLE Syntax Elements - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™
TEMPORARY
The table to be dropped is the materialized instance of a global temporary table.
If you do not specify TEMPORARY and table_name identifies a global temporary table, then the base global temporary definition table is dropped.
If any materialized instances of the base global temporary table exist anywhere in the system, you cannot drop the table and an error is returned.
TEMPORARY is not valid when specified for any database object other than a global temporary table.
TEMPORARY is not valid when specified with the ALL keyword.
FOREIGN
Optional keyword you can specify for readability when dropping a foreign table.
When you drop a foreign table, the external file source is not modified in any way. Only the Vantage local information is removed.
database_name
user_name
Name of the containing database or user for the specified base table or queue table.
This specification is required only if the table to be dropped is contained in a different database than the current database.
table_name
Name of the base table or queue table to be dropped.
The table_name specification cannot identify a journal table.
If the table to be dropped has triggers, hash indexes, or join indexes associated with it, you must first drop those triggers, hash indexes, and join indexes else the request aborts.
ALL
The base global temporary table definition and all its materialized instances are to be dropped when they are not being accessed by any other transactions.
ALL is not valid when specified for any database object other than a global temporary table.
ALL is not valid when specified with the TEMPORARY keyword.
Take care in using this option because the time required for all open transactions accessing this object to commit might be significant.
If you do not specify ALL and if the global temporary table is materialized in any other session, Vantage aborts the request.