15.10 - Indicator Variables and Output - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

prodname
Preprocessor2 for Embedded SQL
vrm_release
15.10
category
Programming Reference
featnum
B035-2446-035K

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 Teradata Database

Action Taken

Null for a column and no indicator variable exists

The SQLCODE in the SQLCA is set to -305 and the value of the receiving main variable remains unchanged.

Negative value

The field is returned to the main variable with no exception conditions.

Positive value

The returned byte or character string is truncated.

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