17.20 - Syntax - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide

Product
ODBC Driver for Teradata
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2022-06-21
dita:mapPath
uqj1639470627591.ditamap
dita:ditavalPath
nkw1500504256726.ditaval

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