ctdbCreateSession
Create a new session table.
Declaration
CTDBRET ctdbCreateSession(CTHANDLE Handle, pTEXT dbengine,
pTEXT userid, pTEXT password)
Description
ctdbCreateSession() creates a new session and session dictionary. The session dictionary file will be created by default in the Server directory (client/server) or in the execution directory (standalone). To change the directory to locate the session dictionary, use ctdbSetSessionPath() before calling ctdbCreateSession(). To create a database, use ctdbCreateDatabase(). To create a table, use ctdbCreateTable().
A session dictionary is required to perform any task with a database, or to logon to a c-tree Server or FairCom DB instance with ctdbLogon(). There must not be more than one session dictionary in a c-tree Server or FairCom DB environment.
Returns
ctdbCreateSession() returns CTDBRET_OK on success, or FairCom DB API error code on failure. If the error code is 19, the session dictionary already exists.
Example
err = ctdbLogon(handle);
if (err == FNOP_ERR) /* Session dictionary doesn't exist*/
err = ctdbCreateSession(handle, "FAIRCOMS", "ADMIN", "ADMIN");
See also
ctdbAllocSession(), ctdbCreateDatabase(), ctdbCreateTable(), ctdbLogon()