Progress
Embedded SQL-92
Guide and Reference


Using Indicator Variables

Indicator variables can be used with input host variables and output host variables. A NULL value can be inserted when an indicator variable is used along with the input host variable, if the indicator variable is set to -1. In the output variables, indicator variables are used to check for NULL values and other error conditions.

When you issue a query, use an indicator variable to check for NULL values on associated columns.

Table 12–1 lists the indicator variable values and their meanings.

Table 12–1: Indicator Variable Values and Their Meanings 
Value
Meaning of Indicator Variable Value
0
The associated host variable contains a non-NULL value. If set by SQL in a fetch operation, 0 also indicates that the value in the host variable has not been truncated.
- 1
The returned value in an OUTPUT operation is NULL and there is no value in the associated host variable. The value of the associated host variable for an UPDATE or INSERT operation is NULL.
> 0
The host variable size was too small to contain the returned value in an OUTPUT operation, and the returned value in the host variable has been truncated. The indicator variable itself contains the > 0 length of the returned value before it was truncated.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095