|Oracle Call Interface Programmer's Guide
Part Number A89857-01
More OCI Relational Functions, 23 of 97
Gets the chunk size of a LOB.
sword OCILobGetChunkSize ( OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *locp, ub4 *chunk_size );
The service context handle.
An error handle you can pass to
OCIErrorGet() for diagnostic information in the event of an error.
The internal LOB for which to get the usable chunk size.
The amount of a chunk's space that is used to store the internal LOB value. This is the amount that users should use when reading/writing the LOB value. If possible, users should start their writes at chunk boundaries, such as the beginning of a chunk, and write a chunk at a time.
chunk_size will be returned in terms of bytes for
BLOBs and in terms of characters for
NCLOBs. For varying width character sets, the value will be the number of Unicode characters that fit in a chunk.
When creating a table that contains an internal LOB, the user can specify the chunking factor, which can be a multiple of Oracle blocks. This corresponds to the chunk size used by the LOB data layer when accessing/modifying the LOB value. Part of the chunk is used to store system-related information and the rest stores the LOB value. This function returns the amount of space used in the LOB chunk to store the LOB value. Performance will be improved if the application issues read/write requests using a multiple of this chunk size. For writes, there is an added benefit since LOB chunks are versioned and, if all writes are done on a chunk basis, no extra/excess versioning is done nor duplicated. Users could batch up the write until they have enough for a chunk instead of issuing several write calls for the same chunk.