5. Embedded QUEL : Host Language Variables : Indicator Variables : Retrieving Data Using Null Indicators
 
Share this page                  
Retrieving Data Using Null Indicators
After you retrieve data into a host variable that is associated with an indicator variable, the indicator variable contains one of the following values:
-1
Value was null. The contents of the host variable are unchanged.
0
Value was not null. The host variable contains the retrieved value.
The following example illustrates the use of an indicator variable. In this example the indicator value is used to detect missing phone numbers, which are listed in a roster as "n/a":
##retrieve cursor emp_cursor (name, phone:phone_null, id)
if (phone_null = -1) then
  update_roster(name, "n/a", id)
else
  update_roster(name, phone, id)
end if
The following EQUEL statements can include indicator variables in their output target lists:
retrieve
retrieve cursor