Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic


Close an open table.


CTDBRET ctdbCloseTable(CTHANDLE Handle)


ctdbCloseTable() closes an open table. When the table is closed, all resources associated with the table fields, indexes, and segments are freed, and the table handle is reset to all default initial parameters.

Notice that the table handle is not deallocated. All locks associated with the table are released. All of the record handles associated with the table are reset (but not deallocated/freed). This means that the "Current Record" pointers in those handles are also reset. All of the field handles, index handles, and segment handles associated with the table are deallocated and their structures in memory are freed up.

Closing the table makes it "non-active." To open a table, use ctdbOpenTable().

  • Handle [in] the table handle


ctdbCloseTable returns CTDBRET_OK on success, or c-treeDB API error code on failure.


eRet = ctdbCloseTable(hTable);

eRet = ctdbFreeTable(hTable);

See also

ctdbAllocTable(), ctdbOpenTable()