UPDATE Statement | SQL Statements | Teradata Vantage - UPDATE (Upsert Form) - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
vjt1596846980081.ditamap
dita:ditavalPath
vjt1596846980081.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantageā„¢

Updates column values in a specified row and, if the row does not exist, inserts the row into the table with a specified set of initial column values. The table must have a primary index and cannot be column partitioned.

For details on the temporal form, see Teradata Vantageā„¢ - Temporal Table Support, B035-1182.

ANSI Compliance

The upsert form of UPDATE is a Teradata extension to the ANSI SQL:2011 standard.

Required Privileges

The following privilege rule applies to both the UPDATE and INSERT portions of this statement:
  • You must have both update and insert privileges on the base table, view, or column set to be updated regardless of which portion of the request is performed.
The following privilege rules applies to the UPDATE portion of this statement:
  • You must have the UPDATE privilege on the base table, view, or column set to be updated.
  • To update rows through a view, you must have the UPDATE privilege on the view.
  • Also, the immediate owner of the view (that is, the database in which the view resides) must have the UPDATE privilege on the underlying object (view or base table).
The following privilege rules apply to the INSERT portion of this statement:
  • You must have the INSERT privilege on the referenced table.
  • To insert rows into a table through a view, you must have the INSERT privilege on the view.

    Also, the immediate owner of the view (that is, the database in which the view resides) must have the INSERT privilege on the underlying object (view or base table).