Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbGetFieldNumberByName

Return the field number, based on the field name and record handle.

Declaration

NINT ctdbGetFieldNumberByName(CTHANDLE Handle, pTEXT FieldName)

Description

ctdbGetFieldNumberByName() returns the field number given the field name and the record handle. Use ctdbGetFieldNumber() to retrieve the field number given the table handle. Use ctdbGetFieldNbr() to retrieve the field number given a field handle.

  • Handle [in] the record handle.
  • FieldName [in] the name that identifies the field in the table.

Returns

ctdbGetFieldNumberByName() returns the field number, or -1 on error.

Example


pMyRec1 = ctdbAllocRecord(pMyTable1);

ctdbFirstRecord(pMyRec1);

fldnbr = ctdbGetFieldNumberByName(pMyRec1, "Name");

See also

ctdbAllocTable(), ctdbGetField(), ctdbGetFieldNbr(), ctdbGetFieldByName(), ctdbGetFieldLength(), ctdbGetFieldName()

TOCIndex