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

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
ft:locale
en-US
ft:lastEdition
2021-07-27
dita:mapPath
spp1591731285373.ditamap
dita:ditavalPath
spp1591731285373.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

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;);