17.10 - Example: Using a Trigger to Update a NoPI Table - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

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

The following CREATE TRIGGER request creates a statement trigger that does an INSERT SELECT of the values represented by a and b from the OLD_TABLE transition table (aliased as myold ) into NoPI table nopi008_t999 whenever NoPI table nopi008_ti is updated.

     CREATE TRIGGER nopi008_trig4 
       AFTER UPDATE ON nopi008_t1
       REFERENCING OLD_TABLE AS myold 
     FOR EACH STATEMENT (
       INSERT INTO nopi008_t999(a,b) 
         SELECT a,b 
         FROM myold;);