Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbAddDatabase

Add an existing database to a session.

Declaration

CTDBRET ctdbAddDatabase(CTHANDLE Handle, pTEXT Name, pTEXT Path)

Description

ctdbAddDatabase() adds an existing database to the present session dictionary. Use the Path parameter to specify where the database dictionary file is on disk. If Path is left empty, c-treeDB API will attempt to locate the file in the Server directory (client/server) or in the execution directory (standalone).

  • Handle [in] the session handle.
  • Name [in] the database name.
  • Path [in] the database path.

Returns

ctdbAddDatabase() returns CTDBRET_OK on success, or a c-treeDB API error code on failure.

Example


eRet = ctdbAddDatabase(hSession, "my_database", "");

if (eRet != CTDBRET_OK)

{

if (eRet == CTDBRET_NOTFOUND)

{

printf("\n\nTable not found at the path.\n");

}

else

{

printf("ctdbAddDatabase returned error code %d\n", eRet);

}

}


See also

ctdbAddTable(), ctdbDropDatabase(), ctdbDropTable()

TOCIndex