Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbFirstTable

Get the name and path of the first table in a database dictionary.

Declaration

CTDBRET ctdbFirstTable(CTHANDLE Handle, pTEXT Name, VRLEN NameSize,

pTEXT Path, VRLEN PathSize)

Description

ctdbFirstTable() gets the name and path of the first table in a database dictionary.

  • Handle [in] the database handle.
  • Name [out] receives the table name.
  • NameSize [in] the Name size in bytes.
  • Path [out] receives the table path.
  • PathSize [in] the Path size in bytes.

ctdbFirstTable(), in conjunction with ctdbNextTable(), may be used to obtain the names and paths of all the tables in this database dictionary. ctdbGetTableCount() may be used to retrieve the total number of tables in the database dictionary.

Returns

ctdbFirstTable() returns CTDBRET_OK on success, or INOT_ERR (101) if there are no tables in the database dictionary, or a c-tree error code on failure.

Example


ctdbFirstTable(hDB, t_name, sizeof(t_name), t_path, sizeof (t_path));

do

{ printf("\ntable name: %s", t_name); }

while (ctdbNextTable(hDB, t_name, sizeof(t_name), t_path,

sizeof(t_path)) == CTDBRET_OK);

See also

ctdbFirstDatabase(), ctdbNextTable(), ctdbFindTable(), ctdbGetTableCount()

TOCIndex