Error Handling and Transaction Semantics - ODBC Driver for Teradata

ODBC Driver for Teradata® User Guide

Product
ODBC Driver for Teradata
Release Number
16.20
Published
August 2020
Language
English (United States)
Last Update
2020-08-25
dita:mapPath
fxv1527114222338.ditamap
dita:ditavalPath
Audience_PDF_product_legacy_odbc_include.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

In Teradata Database, transaction commit, as well as request-level and transaction-level abort for an array request, matches the equivalent multi-statement request. Transaction semantics are the same for emulated and non-emulated parameter array requests. The entire parameter array request is rolled back, including those parameter rows already processed.

Errors are handled exactly the same as they would be for the equivalent multi-statement request. The error information returned from Teradata Database to the client in the resulting failure parcel matches that from the unfolded request, and the parameter set that generated the failure is identified by the statement number in the failure parcel.

If an error occurs while executing a parameter array statement, the execution function returns an error and sets the row number variable to the number of the row containing the error. It is data source-specific whether all rows except the error set execute or all rows before (but not after) the error set execute. In case of an error, ODBC Driver for Teradata always fails the whole parameter array request.

If an error occurs, the statement number in the failure parcel is used to derive the row number of the failing parameter set and to set the corresponding SQL_DIAG_ROW_NUMBER field of the diagnostic record.

The SQL_DIAG_COLUMN_NUMBER field of the diagnostic record is set by the driver to SQL_COLUMN_NUMBER_UNKNOWN because the driver cannot determine the parameter number for the failure.

The buffer specified by the SQL_ATTR_PARAMS_PROCESSED_PTR statement attribute is set to the number of the failed parameter set.