4. Embedded SQL for Fortran : Fortran Variables and Data Types : Variable and Type Declarations : Indicator Variables
 
Share this page                  
Indicator Variables
An indicator variable is a 2-byte integer variable. You can use an indicator variable in an application in three ways:
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 (or byte) data from Ingres, you can use the indicator variable as a check that the associated host variable was large enough to hold the full length of the returned string. However, the preferred method is to use SQLSTATE.
The base type for a null indicator variable must be the integer type integer*2. For example:
C Indicator variable
      integer*2   indvar

C Array of indicator variables
      integer*2 indarr(10)
The word indicator is reserved.
When using an indicator array with a host structure (see Indicator Variables Usage (see page Indicator Variables Usage) in this chapter), you must declare the indicator array as an array of integer*2 variables. In the above example, you can use the variable "indarr" as an indicator array with a structure assignment.