SQLCODE Variable - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

Product
Preprocessor2 for Embedded SQL
Release Number
15.00
Language
English (United States)
Last Update
2018-09-27
dita:id
B035-2446
lifecycle
previous
Product Category
Teradata Tools and Utilities

SQLCODE Variable

 

SQLCODE Variable

Description

negative

An error condition has been reported.

positive

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 a 32-bit signed integer variable:

int SQLCODE;

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.

For details, see SQL Stored Procedures and Embedded SQL (B035‑1148).