17.10 - DELETE DATABASE and SQL UDFs - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

A DELETE DATABASE statement deletes all the database objects contained in the database. If database objects contained within other databases or users reference any of the deleted objects, the referencing objects are no longer valid.

An SQL UDF can reference different database objects in its definition, including UDTs. It is always possible that such objects might be dropped either individually, or collectively when you submit a DELETE DATABASE request. When this happens, it can invalidate the UDF. Conversely, an SQL UDF can itself be referenced by various database objects. If an SQL UDF in such a relationship is dropped, or if its containing database or user is dropped, those database objects then lose their validity.

For example, suppose you have database df2 that contains a table referenced by an SQL UDF in database pls, and for some reason you decide to delete the contents of df2. The next time a request references the affected SQL UDF, the system aborts the request and returns an error to the requestor.