Indicator Variables
An indicator variable is a 2-byte integer variable. There are three possible ways to use these in an application:
• In a statement that retrieves data from Ingres, you can use an indicator variable to determine if its associated host variable was assigned a null.
• In a statement that sets data to Ingres, you can use an indicator variable to assign a null to the database column, form field, or table field column.
• In a statement that retrieves character data from Ingres, you can use the indicator variable as a check that the associated host variable is large enough to hold the full length of the returned character string.
To declare an indicator variable you should use the short_integer data type. The following example declares two indicator variables:
## ind: Short_Integer; -- Indicator variable
## ind_arr: array(1..10) of Short_Integer; -- Indicator array
Note that a variable declared with any derivative of the short_integer data type will be accepted as an indicator variable.