Indicator Variables and Input - Teradata Preprocessor2

Teradata® Preprocessor2 for Embedded SQL Programmer Guide - 17.20

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Preprocessor2
Release Number
17.20
Published
April 2023
ft:locale
en-US
ft:lastEdition
2023-04-21
dita:mapPath
neh1679404006646.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2446
Product Category
Teradata Tools and Utilities
Use indicator variables:
  • when the application requires the database to set a column null, such as when executing an INSERT or UPDATE statement.
  • within a WHERE clause condition with host variables to handle a null.
Indicator Variable Value Description
negative The value in the associated main variable is ignored. PP2 sends a null to the database for the column.
zero or positive The host variable value is sent to the database as the column value.

For example:

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