Indicator Variables and Output - 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

Indicator variables can be associated with the output main variables used in the INTO clause of a data returning statement or cursor FETCH statement.

Value Returned from the Database Description
Null for a column and no indicator variable exists The SQLCODE in the SQLCA is set to -305. The value of the receiving main variable remains unchanged.
Negative value The field was returned to the main variable with no exception conditions.
Positive value The returned byte or character string was truncated.

This value represents the original length of the string before truncation.

For example:

EXEC SQL
      SELECT col1
      INTO   :hostvar1 :indvar1
      FROM   table1
      WHERE  col1 = :hostvar2;
EXEC SQL
      FETCH  cursor1 INTO :hostvar1 :indvar1;