Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbGetFieldAsString

Retrieve field as CTSTRING value.

Declaration

CTDBRET ctdbGetFieldAsString(CTHANDLE Handle, NINT FieldNbr,

CTSTRING pValue, VRLEN size)

Description

ctdbGetFieldAsString() retrieves field as CTSTRING value. Use ctdbSetFieldAsString() to set field as a CTSTRING value.

  • Handle [in] the record handle.
  • FieldNbr [in] the field number to be retrieved. To retrieve the field number given the record handle, use ctdbGetFieldNumberByName().
  • pValue [out] the pointer to the string value.
  • size [in] pValue size in bytes.

Returns

ctdbGetFieldAsString() returns CTDBRET_OK if successful, or the c-tree error code on failure.

Calling this function against a NULL CTDATE or CTTIMESTAMP field will return the following error codes:

  • CTDATE: CTDBRET_INVDATE
  • CTDATETIME: CTDBRET_INVDATETIME

Calling this function against a NULL field of other types will return CTDBRET_OK and populate the pValue parameter with the following values:

  • CTBOOL: ”False”
  • CTBIGINT, CTSIGNED, CTUNSIGNED, CTFLOAT, and CTNUMBER: ”0”
  • CTMONEY: ”0.00”
  • CTCURRENCY: ”0.0000”
  • CTTIME: ”12:00 AM”
  • CTSTRING: ””

See also

ctdbAllocRecord(), ctdbGetFieldAsBool(), ctdbGetFieldAsSigned(), ctdbGetFieldAsUnsigned(), ctdbGetFieldAsDate(), ctdbGetFieldAsTime(), ctdbGetFieldAsMoney(), ctdbGetFieldAsFloat(), ctdbGetFieldAsDateTime(), ctdbGetFieldAsBlob(), ctdbSetFieldAsString(), ctdbGetFieldNumber()

TOCIndex