Working with TablesA database may contain multiple tables, and a table may belong to multiple databases. Tables created using the c-treeDB interface are kept as files with the extension .dat. Indices are stored in separate files with the extension .idx. The general process to create and use a c-treeDB table and its associated indices is as follows:
Before you can work with an existing table, the table must be opened as follows:
With c-treeDB, it is possible to modify an existing table. The general process to modify a table after it has been created is as follows:
More details on this process are described in "Altering a table". In general, the table creation is done once in the application; the table is opened and the data is added in a separate routine. During table creation, besides the table layer itself, three c-treeDB APIs will be directly involved: the fields, indices and segments. These APIs are only directly involved when the table is being created, or in the event the table structure is modified. When records are being added to or searched in the table, these APIs are not relevant, but the record layer is crucial. With this in mind, this section on Tables discusses these layers in the appropriate order:
|
|||