Indicator Variables and Input - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

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

Indicator Variables and Input

Use indicator variables:

  • when the application requires the Teradata 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 Teradata Database for the column.

    zero or positive

    The host variable value is sent to the Teradata 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;