SQLCODE Field - Teradata Preprocessor2

Teradata® Preprocessor2 for Embedded SQL Programmer Guide

Product
Teradata Preprocessor2
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2020-06-19
dita:mapPath
whb1544831946911.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2446
lifecycle
previous
Product Category
Teradata Tools and Utilities

In particular, the SQLCODE field of the SQLCA contains a negative number when an error condition is reported. If no exception or error condition is encountered during processing, PP2 sets the SQLCODE field to zero.

Some exception conditions, however, are not reflected in SQLCODE. For example, data truncation on assignment of a value to a host variable or return of a null value is not reported directly. In these cases, the SQLWARN fields or any indicator variables associated with a host variable are set to indicate these conditions.

The application must always check the SQLCODE field upon return from processing an executable statement. The WHENEVER statement, illustrated below, is one method to perform SQLCODE checking. For details on the SQLCA fields, see SQL Stored Procedures and Embedded SQL (B035-1148).