SQLCODE Field |Teradata Preprocessor2 for Embedded SQL (PP2) - SQLCODE Field - 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

In particular, the SQLCODE field of the SQLCA contains a negative value 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 the SQLCODE.

For example, data truncation on assignment of a value to a host variable or return of a null value are 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 should always check the SQLCODE field upon return from processing an executable statement. Use the WHENEVER statement as one method to accomplish SQLCODE checking.

For details on the SQLCA fields, see Teradata Vantage™ - SQL Stored Procedures and Embedded SQL, B035-1148.