Using the ASTERISK (*) Character in Macros - 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
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™

A macro defined using the ASTERISK (*) character is bound to the definitions of any tables it references as they were defined at the time the macro was created or replaced.

For example, consider the following macro:

     CREATE MACRO get_emp AS (
       SELECT *
       FROM employee;)

If a column is later added to or removed from the employee table, the following statement still returns the number of columns that existed in employee when get_emp was defined:

     EXEC get_emp;

If columns have been dropped or data types have been changed, performing the macro can result in an error message or unexpected behavior.