Product Documentation

c-treeACE V10.0 Update Guide

Previous Topic

Next Topic

Add Tables with Same Filenames to a c-treeDB Database

A common migration scenario for c-treeDB users is to import multiple tables into a single database that share the same physical file name, even though they reside in separate directories.

c-treeDB initially imposed a restriction of a unique physical file per table name in a database. This did not allow, for example, tables with different symbolic names to reference files with the same names but located in separate directories. This ability has been added to c-treeACE V9.3. Tables can now reference files based on a physical file name.

This is now supported with the ctdbAddTableXtd() API call.

ctdbAddTableXtd(CTHANDLE Handle, pTEXT Name, pTEXT PhysicalName, pTEXT Path)

This function allows adding a table to a c-treeDB 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(), etc..

When adding tables with a logical name different from the physical name the index names are automatically assigned by c-treeDB ignoring values stored in the IFIL resource.

c-treeDB Database Dictionary Update

To enable this feature, a new field (index_basename) was added to the database dictionary using space at the beginning of the reserved field. Additional logic to use existing dictionaries without this new field was also included, in which case it is not allowed to have logical names the same as physical names (new error code). Also included in this dictionary change was the removal of NULFLD support and RECBYT indexes for efficiency.

Importing to SQL

The c-treeACE SQL import utility, ctsqlimp, has been updated to allow importing tables with the same physical file name.

TOCIndex