Syntax - ODBC Driver for Teradata - 16.20

ODBC Driver for Teradata® User Guide

prodname
ODBC Driver for Teradata
vrm_release
16.20
category
User Guide
featnum
B035-2526-108K

The syntax for Atomic UPSERT is straightforward and self-explanatory, consisting of an UPDATE statement and an INSERT statement separated by an ELSE keyword, as follows:

UPDATE <update-operands> ELSE INSERT <insert-operands>

The <update-operands> and <insert-operands> are operands for regular UPDATE and INSERT SQL statements, respectively.

UPDATE Sales SET ItemCount = ItemCount + 1 WHERE (ItemNbr = 20 AND SaleDate = '05/30/2000') ELSE INSERT INTO Sales (20, '05/30/2000', 1);