Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

Actual field length

Call ctdbGetFieldDataLength() to retrieve the actual field size (the number of bytes actually being consumed by the data in that field, in one record (row) of the table). The actual size of variable-length fields, such as CT_VARCHAR and CT_VARBINARY, may vary from the defined size.

/* check if field 0 actual size is different from defined size */

if (ctdbGetFieldSize(hRecord, 0) != ctdbGetFieldDataLength(hRecord, 0))

printf("Field 0 defined and actual sizes are different\n");

TOCIndex