15.10 - Example: Adding to a Mailing List Using UDTs - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

The following example adds new California customers to a mailing list using UDTs.

     CREATE TRIGGER CA_Mailing_list 
       AFTER INSERT ON customer
       REFERENCING NEW AS NewRow
     FOR EACH ROW
       WHEN (NewRow.address.state() = 'CA')
         INSERT INTO MailingAddresses 
         VALUES (NewRow.Name.Last(), NewRow.Name.First(),                  NewRow.address);