#docslug#/ecob/ecob/V1.1.6/indicator-variable The indicator variable is used to process variables with NULL values. When you execute the SELECT or FETCH statement, an error is returned if the indicator variable is not used and the returned column value is NULL. The indicator variable must use the short data type and be appended to the end of host variables.
Syntax of the indicator variable:
:host_variable [INDICATOR] :indicator_variable
After the indicator variable is used, OceanBase Embedded SQL in C (ECOB) can detect whether the returned column value is NULL.
When the returned value of the indicator variable is -1, the database returns a NULL value.
When the returned value of the indicator variable is 0, the column values are assigned to the output host variables.
When the returned value of the indicator variable is greater than 0, the truncated column values are assigned to the output host variables, and the indicator variable stores the actual length of the column values.
When the returned value of the indicator variable is -2, the truncated column values are assigned to the output host variables with an uncertain length.