The Table object represents a GDB table, a GDB temporary table, or an external database table (by external database tables are understood not only tables of data but also views, synonyms, and system tables provided by an ODBC data source). To access table records, it is necessary to use the Table::OpenRecordset method that creates the Recordset object – a set of records.
Temporary tables are local for every session performing shared access to GDB and exist in GDB only during a session. Modifying temporary table records and its structure is performed beyond GDB transactions.
Queries (objects of class Query) can be based on temporary tables. This version of the GIS kernel does not provide an opportunity to create mixed queries based on temporary and persistent GDB tables. Queries based on temporary tables cannot be cataloged.
You cannot link temporary tables with feature types and cannot use them as a cross table for the indirect link between a table or a query of external database and a feature type.
The GIS kernel does not provide an opportunity to create tables in external databases.
To create a new table in GDB, the following sequence of actions should be performed:
Create the Table object by the GeoDatabase::CreateTable method.
Create a table field by the Table::CreateField method.
Set properties for the created field.
Add the field to the Table::Fields collection by the Append method.
Repeat steps 2 – 4 for each table field.
Add the table to the GeoDatabase::Tables collection by the Append method to create a GDB table or to the GeoDatabase::TemporaryTables collection to create a temporary table.
If adding the table to the GeoDatabase::Tables or GeoDatabase::TemporaryTables collection has succeeded, this table gets an internal number. Besides, internal numbers are assigned to the table fields. Continuity of internal numbers is not guaranteed. Assigned internal numbers to persistent GDB tables do not change between GDB sessions. Internal numbers may change at GDB reorganization performed by the GDBEngine::CompactGDB method with the gdbCompactNoKeepISN mode.
To access tables in the GeoDatabase::Tables, GeoDatabase::TemporaryTables and ExternalDatabase::Tables collections, use the Item method. The argument of the method can be a string (the table name) or an integer (the table internal number). For details on forming the external table name, see the description of the ExternalDatabase::Tables collection.
To access fields in the Table::Fields collection, use the Item method. The argument of the method can be a string (the field name) or an integer (the field internal number). The fields can only be accessed by name until the Table object is not added to the GeoDatabase::Tables or GeoDatabase::TemporaryTables collection.