Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbSetFieldBinaryFlag

Set extra field information on how the binary content of the field needs to be handled. c-treeDB API has specific behaviors for CT_ARRAY, CT_2STRING, and CT_NUMBER.

Alternate name for this function: ctdbSetBinaryFlag().

Note: ctdbSetBinaryFlag() requires a field number parameter, which is not required by ctdbSetFieldBinaryFlag():
CTDBRET ctdbDECL ctdbSetBinaryFlag(CTHANDLE Handle, NINT fldno, CTDB_BINARY_FLAG flag);

Declaration

CTDBRET ctdbSetFieldBinaryFlag(CTHANDLE Handle, CTDB_BINARY_FLAG flag)

Parameters:

  • Handle [IN] - Field handle.
  • CTDB_BINARY_FLAG - A value of the CTDB_BINARY_FLAG enum defined in CTDBSDK.H. The possible field binary flag values are:

    CTDB_BINARY_UNKNOWN - (CT_ARRAY or CT_2STRING fields) Table created by c-treeDB API prior to V9. Indicates that the field may or may not have an extra 4 bytes at the beginning of data.

    CTDB_BINARY_FIXED - (CT_ARRAY or CT_2STRING fields) Table created by c-treeDB API V9 or later, so CT_ARRAY and CT_2STRING fields are handled correctly.

    CTDB_BINARY_WITH_LENGTH - (CT_ARRAY or CT_2STRING fields) Table was created prior to V9 and only FairCom DB SQL has operated on it, so the CT_ARRAY and CT_2STRING fields have four bytes at the beginning of the data. This flag was most likely updated by a utility.

    CTDB_BINARY_WITHOUT_LENGTH - (CT_ARRAY or CT_2STRING fields) Table created by c-treeDB API prior to V9. A utility has updated this resource.

    CTDB_BINARY_VARCHAR - (CT_2STRING) Fields created by FairCom DB SQL V10 and later. This field content is interpreted by SQL as a VARCHAR.

    CTDB_NUMBER_MONEY - (CT_NUMBER field) This field is interpreted by SQL as a MONEY type.

    CTDB_BINARY_CLOB and CTDB_BINARY_BLOB - (CLOB and BLOB fields in V10 and later) - Reserved for future use.

    CTDB_FIELDFLAG_USER1 - CTDB_FIELDFLAG_USER10 (V11.5 and later) - (All field types) These values can be used on any field type to carry information that can be used by the programmer to determine a different handling of the field content. For example, when using the c-treeDB API Type SDK (callbacks), these flags can be used to signal fields that need to be converted from a proprietary type to a c-tree defined type so they can be properly handled by c-treeDB API/SQL.

Return Values

Value

Symbolic Constant

Explanation

0

CTDBRET_OK

Successful operation.

See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values.

See Also

TOCIndex