Auto Generated Key Retrieval - Teradata Preprocessor2

Teradata® Preprocessor2 for Embedded SQL Programmer Guide - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Preprocessor2
Release Number
20.00
Published
October 2023
ft:locale
en-US
ft:lastEdition
2023-11-20
dita:mapPath
nyr1691484085721.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
xfi1470440464166
Product Category
Teradata Tools and Utilities

With the Auto Generated Key Retrieval (AGKR) feature, a client application can retrieve an identity column value, or a whole row, from the 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
The database does not support the use of the AGKR feature with UPSERT and MERGE-INTO.