Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

Add, edit or delete indexes

By calling one of the following index management methods, the table definition is marked as modified. For the changes to be reflected on the data and index files, you must call CTTable::Alter() method.

To add or delete an index from a table, call CTTable::AddIndex() and CTTable::DelIndex(). To edit index properties call CTIndex::SetEmptyChar(), CTIndex::SetDuplicateFlag(), and CTIndex::SetNullFlag().

To add, insert or delete index segments from an index, call one of the overloaded methods CTTable::AddSegment(), CTTable::InsSegment(), or CTTable::DelSegment().

Most changes relating to indexes will trigger the CTTable::Alter() method to perform only an index rebuild. If only one index if affected, CTTable::Alter() will only rebuild the affected index. If changes affect more than one index, CTTable::Alter() may rebuild all indexes.

After a successful alter table, all records associated with the altered table will automatically re-initialize to reflect any new table field and index definitions.

TOCIndex