ANSI Compliance - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

MERGE is ANSI SQL:2011-compliant.

Note that in the ANSI definition, this statement is named MERGE INTO, while in the Teradata definition, INTO is an optional keyword.

The privileges required to perform MERGE depend on the merge matching clause of the request you submit.

 

IF you specify this type of merge matching clause …

THEN you must have this privilege …

WHEN MATCHED

UPDATE on every column of target_table that is specified in the UPDATE SET set clause list.

DELETE on every column of target_table that is specified in the DELETE SET set clause list.

WHEN NOT MATCHED

INSERT on target_table.

The INSERT privilege is also required on all of the columns specified in the INSERT column list.

both

  • SELECT on any source table specified in a USING subquery.
  • all the update and insert privileges required for the WHEN MATCHED and WHEN NOT MATCHED clauses.
  • Note: DELETE cannot be combined with INSERT or UPDATE in a MERGE statement.

    The privileges required for a MERGE … LOGGING ERRORS operation are the same as those for MERGE operations without a LOGGING ERRORS option with the exception that you must also have the INSERT privilege on the error table associated with the target data table for the MERGE operation.