Contents Index Using host variables in C++ Using indicator variables to handle NULL

UltraLite Embedded SQL User's Guide
  Data Access Using Embedded SQL

Using indicator variables


An indicator variable is a C variable that holds supplementary information about a particular host variable. You can use a host variable when fetching or putting data. Use indicator variables to handle NULL values.

An indicator variable is a host variable of type short int. To detect or specify a NULL value, place the indicator variable immediately following a regular host variable in a SQL statement.

Example 
Indicator variable values 

The following table provides a summary of indicator variable usage.

Indicator Value Supplying Value to database Receiving value from database
0 Host variable value Fetched a non-NULL value.
-1 NULL value Fetched a NULL value

Using indicator variables to handle NULL

Contents Index Using host variables in C++ Using indicator variables to handle NULL