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

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
jpx1556733107962.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

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.