当前位置: 首页 > 工具软件 > Indicator > 使用案例 >

Indicator Variables

姜彬郁
2023-12-01
 

Indicator Variables

1.       Function: Processing NULL Data

2.       The value of Indicator Variable (SMALLINT)

l         >=0 (usually 0), indicate that the column is not NULL

l         <0 (usually -1), indicate that the column is NULL

l         -2, indicate that the column value can’t be stored in host variable for the reason that numeric conversion could not be performed or arithmetic expression error occurred

l         -3, indicate that a hole was detected for the row on a multiple row FETCH, and values were not returned for the row. SQLCODE +222, is also returned for that row.

3.       Indicator Variable Usage

l         When using SELECT or FETCH statement in SQL, indicator variables are set by DB2 according to the property of the relevant column(NULL or NOT NULL)

l         When using UPDATE or INSERT statement in SQL, the programmer need to set the value of indicator variables to tell DB2 that the relevant column is NULL or NOT NULL

 类似资料:

相关阅读

相关文章

相关问答