15.10 - Auto Generated Key Retrieval - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

prodname
Preprocessor2 for Embedded SQL
vrm_release
15.10
category
Programming Reference
featnum
B035-2446-035K

With the Auto Generated Key Retrieval (AGKR) feature, a client application can retrieve an identity column value, or a whole row, from the Teradata Database. To use the AGKR feature, include one of the following embedded SQL statements before using an INSERT statement.

To switch off the AGKR feature (this is the default):

EXEC SQL SET RETURNGENERATEDKEYS OFF

To return only the identity column value syntax:

EXEC SQL SET RETURNGENERATEDKEYS COLUMN

To return the entire row:

EXEC SQL SET RETURNGENERATEDKEYS ROW

Note: Teradata Database does not support the use of the AGKR feature with UPSERT and MERGE‑INTO.