Partager via


BLOBs as In-Memory Data

When a BLOB is treated as in-memory data, it is sent or retrieved in a single piece of memory. If the consumer allocates the memory for the BLOB, it usually binds the column with a type indicator of DBTYPE_BYTES, DBTYPE_STR, or DBTYPE_WSTR, depending on the data contained in the BLOB. When getting data, if the consumer wants the provider to allocate the memory for the BLOB, it usually binds the column with one of the preceding type indicators combined with DBTYPE_BYREF.

To get the BLOB data, the consumer calls a method such as IRowset::GetData with an accessor containing this binding and the provider returns the entire contents of the BLOB to the consumer. To set the BLOB data, the consumer calls a method such as IRowsetChange::SetData with an accessor containing this binding and sends the entire contents of the BLOB to the provider. This is no different from binding and getting or setting data in other columns, such as getting or setting data in an integer column. If consumers get or set character data in this manner, the data is null-terminated.

This topic is a part of: