17.10 - When the Actual User or Database Does Not Match the Definition Reported by SHOW MACRO or SHOW VIEW - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

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

When you copy or restore an archived macro or view definition to a different database or user than the one from which it had been archived, later SHOW MACRO or SHOW VIEW requests display the containing database or user for the original CREATE text for the macro or view stored in DBC.TVM.RequestText, not updated CREATE text that indicates the database or user into which the archived view or macro definition has been copied or restored.

This behavior is different from that for other SHOW statements, which generate the SQL text for the current definition of the specified object by building a parsing tree for the text from data in the table header and then working backward to return the SQL text for the current definition of the object. This reconstruction of definition text is not possible for macros and views because they do not have table headers from which current SQL definition text can be generated.