Rules for Indicator Variables - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

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

The numbers that are contained in indicator variables specify, to the application, varying values.

 

Number Contained in Indicator Variable

Specification to the Application

A negative number (most commonly ‑1)

The associated input main variable is null, or a null value was successfully returned.

Zero

The associated input main variable is non‑null or a non‑null value was successfully returned with no exception conditions applied.

A positive number

Truncation has occurred when returning a character or byte string to the associated main variable.

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

An indicator variable is defined as a 2 byte integer (smallint). In C, this is declared as:

short identifier;

A host variable is recognized for use as an indicator only if the short characteristic is coded; int is not equivalent on any platform.