Dropping and Renaming Objects | SQL Fundamentals | Teradata Vantage - 17.10 - Dropping and Renaming Objects - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL Fundamentals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1141-171K
Language
English (United States)

To drop an object, use the appropriate DDL statement.

Dropping Objects

Object Use
Constraint DROP CONSTRAINT
Error logging table DROP ERROR TABLE
DROP TABLE
Hash index DROP HASH INDEX
Join index DROP JOIN INDEX
Macro DROP MACRO
Profile DROP PROFILE
Role DROP ROLE
Secondary index DROP INDEX
Stored procedure DROP PROCEDURE
Table DROP TABLE
Global temporary table or volatile table
Primary index
Trigger DROP TRIGGER
User-defined function DROP FUNCTION
User-defined method ALTER TYPE
User-defined type DROP TYPE
View DROP VIEW

Renaming Objects

Teradata SQL provides RENAME statements that you can use to rename some objects. To rename objects that do not have associated RENAME statements, you must first drop them and then recreate them with a new name, or, in the case of primary indexes, use ALTER TABLE.

Object Use
Hash index DROP HASH INDEX and then CREATE HASH INDEX
Join index DROP JOIN INDEX and then CREATE JOIN INDEX
Macro RENAME MACRO
Primary index ALTER TABLE
Profile DROP PROFILE and then CREATE PROFILE
Role DROP ROLE and then CREATE ROLE
Secondary index DROP INDEX and then CREATE INDEX
Stored procedure RENAME PROCEDURE
Table RENAME TABLE
Global temporary table or volatile table
Queue table
Error logging table
Trigger RENAME TRIGGER
User-Defined Function RENAME FUNCTION
User-Defined Method ALTER TYPE and then CREATE METHOD
User-Defined Type DROP TYPE and then CREATE TYPE
View RENAME VIEW

Related Information

For more information on these statements, including rules that apply to usage, see Teradata Vantageā„¢ - SQL Data Definition Language Syntax and Examples, B035-1144.