15.10 - Indicator Variables and Input - 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 used when the application requires the Teradata Database to set a column value to null, such as when executing an INSERT or UPDATE statement.

Indicator variables can be used within a WHERE clause condition with host variables to indicate a null. A negative value indicates the value in the associated main variable is to be ignored and PP2 is to send a null to the Teradata Database for the column. A zero or positive value specifies the main variable value is to be sent to the Teradata Database as the column value.

EXEC SQL
      INSERT table1 VALUES (:hostvar1 :indvar1);
EXEC SQL
      UPDATE table1
         SET col1 = :hostvar1 :indvar1
         WHERE col1 = :hostvar2;