An indicator variable is a 2-byte integer (BIN FIXED(15)). On retrieval, an indicator variable is used to show whether its associated host variable has been assigned a null value. On assignment to a column, a negative indicator variable is used to indicate that a null value should be assigned.
Indicator variables are declared in the same way as host variables and the declarations of the two can be mixed in any way that seems appropriate to the programmer.
The SQL Preprocessor does not require that indicator arrays have a lower bound of one.
An indicator variable must have the attribute REAL NATIVE SIGNED FIXED BIN(15).
Given the statement:
exec sql fetch Cls_Cursor into :Cls_Cd,
:Day :Day_Ind,
:Bgn :Bgn_Ind,
:End :End_Ind;Variables can be declared as follows:
exec sql begin declare section; dcl Cls_Cd char(7); dcl Day bin fixed(15); dcl Bgn char(8); dcl End char(8); dcl (Day_Ind, Bgn_Ind, End_Ind) bin fixed(15); exec sql end declare section;