Example: SHOW MACRO - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The following request displays the most recently run definition of the new_emp macro.

     SHOW MACRO new_emp;

The database system reports the following macro definition.

     REPLACE MACRO new_emp(   
       name   CHARACTER(20) NOT NULL, 
       street CHARACTER(30), 
       city   CHARACTER(20), 
       number INTEGER, 
       dept   SMALLINT DEFAULT 999)
     AS (INSERT INTO employee (name, street, city,
                   emp_no, dept_no)
           VALUES (:name, :street, :city, :number, :dept); 
          UPDATE department 
           SET emp_count = emp_count + 1 
          WHERE  dept_no = :dept;);