When the Actual User or Database Does Not Match the Definition Reported by SHOW MACRO or SHOW VIEW - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
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.