Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbSetLogonOnly

Set the session logon only flag.

Declaration

CTDBRET ctdbSetLogonOnly(CTHANDLE Handle, CTBOOL flag)

Description

ctdbSetLogonOnly() sets the session logon only flag. This flag, when set to YES before the session Logon, will prevent the session from using the session dictionary. If the session dictionary may not be used, the database dictionary cannot be used. With this, any information related to databases or tables cannot be use, but the tables can yet be opened or created using the session handle, as can be seen in the example below.

To retrieve the flag, use ctdbGetLogonOnly().

  • Handle [in] the Sesion Handle.
  • flag [in] logon only flag value.

Returns

ctdbSetLogonOnly() returns CTDBRET_OK on success, or FairCom DB API C API error on failure.

Example


CTSESSION_TYPE ctdbsess=CTSESSION_CTDB;

CTHANDLE hSession = ctdbAllocSession(ctdbsess);

CTHANDLE hTable = ctdbAllocTable(hSession);

CTDBRET err;

err = ctdbSetLogonOnly(hSession, YES);

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

pMyField0 = ctdbAddField(pMyTable, "Name" , CT_FSTRING,32);

pMyField1 = ctdbAddField(pMyTable, "Balance", CT_SFLOAT, 4);

pMyIndex = ctdbAddIndex(pMyTable, "iName", CTINDEX_FIXED,NO,NO);

pMyIseg = ctdbAddSegment(pMyIndex, pMyField0, 2);

RetVal = ctdbCreateTable(pMyTable,"Table1",CTCREATE_NORMAL);

err = ctdbLogout(hSession);

ctdbFreeTable(hTable);

ctdbFreeSession(hSession);

See also

ctdbGetLogonOnly(), ctdbLogon()

TOCIndex