Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic


Open an existing table, given its UID.


CTDBRET ctdbOpenTableByUID(CTHANDLE Handle, ULONG uid,



ctdbOpenTableByUID() opens an existing table, given its unique identifier. The database that contains the table was specified previously, when table handle ‘Handle’ was allocated. c-treeDB API will look for the table and index files in the server directory (client/server applications) or in the execution directory (standalone applications).

To override this default directory, specify your own directory with ctdbSetTablePath() before you call this function.

To open a table that is protected with a password, call ctdbSetTablePassword() with Handle before you call this function.

To open the table given its name, use ctdbOpenTable(). To create a table, use ctdbCreateTable(). To retrieve the table open mode, use ctdbGetTableOpenMode(). To close an open table, use ctdbCloseTable().

  • Handle [in] the Table Handle, previously allocated and associated with a database by calling ctdbAllocTable().
  • uid [in] the table unique identifier.
  • OpenMode [in] the table open mode. The valid values for the table open mode are listed in c-treeDB API definitions.


ctdbOpenTableByUID() returns CTDBRET_OK on success, or c-treeDB API error on failure.

See also

ctdbAllocTable(), ctdbCreateTable(), ctdbGetTableOpenMode(), ctdbCloseTable(), ctdbOpenTable()