Syntax - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide - 17.20

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
ODBC Driver for Teradata
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-11-18
dita:mapPath
uqj1639470627591.ditamap
dita:ditavalPath
nkw1500504256726.ditaval
dita:id
ktb1507075385726
Product Category
Teradata Tools and Utilities

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