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
本文详细介绍了DB2中Indicator Variables的作用及使用方法。包括处理NULL数据的功能、不同值所代表的意义,以及在SQL语句中如何被设置或利用。
767

被折叠的 条评论
为什么被折叠?



