Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbCloseTable

Close an open table.

Declaration

CTDBRET ctdbCloseTable(CTHANDLE Handle)

Description

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

Returns

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

Example


eRet = ctdbCloseTable(hTable);

eRet = ctdbFreeTable(hTable);


See also

ctdbAllocTable(), ctdbOpenTable()

TOCIndex