Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbFindDatabase

Get the path of a database by name.

Declaration

CTDBRET ctdbFindDatabase(CTHANDLE Handle, pTEXT Name, pTEXT Path,

VRLEN PathSize)

Description

ctdbFindDatabase() retrieves the path of any database in the session dictionary by name.

Use ctdbFindDatabaseByUID() to get the name and path of a database by its unique identifier.

Use ctdbFindActiveDatabase() to get the session handle of an active/connected database by name.

  • Handle [in] - the handle of the session dictionary that will be searched.
  • Name [in] - the string with the database name to lookup in the session dictionary.
  • Path [out] - receives the database path, if the name is located and Path is large enough to hold the database path.
  • PathSize [in] - the size in bytes of Path. If Path is not large enough to receive the database path, ctdbFindDatabase() will return CTDBRET_ARGSMALL (4006).

Returns

ctdbFindDatabase() returns CTDBRET_OK on success, or INOT_ERR (101) if the database is not in the session dictionary, or a c-tree error code on failure.

Example


eRet = ctdbLogon(hSession, "FAIRCOMS", "ADMIN", "ADMIN");

eRet = ctdbFindDatabase(hSession, db_name, db_path, sizeof(db_path));


See also

ctdbFindDatabaseByUID(), ctdbFirstDatabase(), ctdbNextDatabase(), ctdbFindActiveDatabase()

TOCIndex