5. Working with Embedded SQL : Host Language Variables in Embedded SQL : Indicator Variables : Indicator Variable Declaration
 
Share this page                  
Indicator Variable Declaration
Like other host language variables, an indicator variable must be declared to embedded SQL in a declare section.
In an embedded SQL statement, the indicator variable is specified immediately after the host language variable, with a colon separating the two:
host_variable:indicator_variable
Or you can use the optional keyword indicator in the syntax:
host_variable indicator :indicator_variable
When used to detect or assign a null, indicator variables are commonly termed null indicator variables.
Specify indicator variables in association with host language variables that contain the following data:
Database column value
Constant database expression
Form field value
Table field column value
For example, the following example associates null indicators with variables representing column values:
exec sql select ename, esal
     into :name:name_null, :salary:sal_null
     from employee;