Windows Dev Center

Appearance of NULLs in a Flattened Rowset

NULLs appear in the flattened rowset in two different situations:

  • To indicate that a member is not present on the axis — for example, in column 2 of rows 4 and 5 of the flattened dataset diagrammed in the complex flattened rowset example. In the dataset, "Months" for Qtr3 and Qtr4 are not on the axis.

  • To indicate that a cell is empty. For example, the flattened dataset diagrammed in the DIMENSION PROPERTIES example has NULLs in the last column of the first row. This is because Venkatrao did not have any sales of Microsoft® Excel in the USA for the first quarter of 1991. The corresponding cell in the dataset is empty.

When a consumer calls IRowset::GetData, DBSTATUS_ISNULL is returned. DBSTATUS_ISNULL is one of the status codes defined in OLE DB. An application allocates a buffer, and for each column it requests, it has space to hold the following information:

  • The actual data value (called the VALUE part).

  • The status after fetch, such as NULL indication or truncation indication (called the STATUS part).

  • The number of bytes of data fetched for variable-length data (called the LENGTH part).

DBSTATUS_ISNULL is written into the STATUS part of the consumer's buffer. When this status occurs, the VALUE part is meaningless.

© 2015 Microsoft