ctdbAddTable
Add an existing table to a database.
Declaration
CTDBRET ctdbAddTable(CTHANDLE Handle, pTEXT Name, pTEXT Path)
Description
ctdbAddTable() adds an existing table to a database. Use the Path parameter to specify where the table files are on disk. If Path is left empty, FairCom DB API will attempt to locate the files in the Server directory (client/server) or in the execution directory (standalone).
A mirrored table can be added to a FairCom DB API database dictionary by calling the ctdbAddTable() function and specifying the table name and path using the appropriate mirror naming convention:
if (ctdbAddTable(hDatabase, "customer|mirror", "primary_path|mirror_path"))
printf("ctdbAddTable failed\n");
If a table is created originally without mirroring, it can subsequently be mirrored as follows:
Returns
ctdbAddTable() returns CTDBRET_OK on success, or the c-tree error code on failure.
Example
CTHANDLE hTable;
eRet = ctdbAddTable(hTable, "custmast", "");
See also
ctdbAddTableXtd (ctdbAddTableXtd, ctdbAddTableXtd), ctdbCreateTable, ctdbAllocTable, ctdbDeleteTable, ctdbDropTable, ctdbSetDefaultSqlTableOwner