SQLCODE Variable - 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

SQLCODE contains a negative value when an error condition is reported. A positive value indicates that a warning has occurred. If no exception or error condition is encountered during processing, PP2 sets the SQLCODE variable to zero.

SQLCODE is defined as:

Definition: 01 SQLCODE PIC S9(9) <comp>;

Where <comp> is COMP-5 for MF COBOL and COMP for all other COBOL compilers.

Some exception conditions are not reflected in the SQLCODE.

Data truncation on assignment of a value to a host variable is returned in SQLCODE(+902).

The application should always check the SQLCODE variable upon return from processing an executable statement. Use the WHENEVER statement as one method to accomplish SQLCODE checking.

A SQLCODE and a SQLSTATE variable can be defined for the same compilation unit. Both contain valid result codes.