ctdbAddTableXtd
Add an existing table to a database with additional physical file information.
Declaration
ctdbAddTableXtd( CTHANDLE Handle, pTEXT Name, pTEXT PhysicalName, pTEXT Path )
Description
ctdbAddTableXtd() 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, c-treeDB API will attempt to locate the files in the Server directory (client/server) or in the execution directory (standalone).
This extended function allows adding a table to a c-treeDB API database specified with a logical and physical table name (the physical table name is the name on disk without extension and path), the logical table name is the one associated with file operations such as ctdbOpenTable().
Note: While multiple files with the same physical names can be added to a c-treeDB API database dictionary, they logical names must still be unique.
A mirrored table can be added to a c-treeDB API database dictionary by calling 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, "custmast1", "customer.dat" "c:\company1");
eRet = ctdbAddTable(hTable, "custmast2", "customer.dat" "c:\company2");
See also
ctdbAddTable(), ctdbCreateTable(), ctdbAllocTable(), ctdbDeleteTable(), ctdbDropTable()