skip to main content
Schema Management : Schema Objects : Index Catalog Table: OA_STATISTICS
 

Index Catalog Table: OA_STATISTICS

The OA_STATISTICS table contains the table index statistics to support the SQLStatistics ODBC call. It contains one row for every column that has an index on it and additional rows for table statistics. The table is accessed from ODBC with a SQLStatistics call.
For example, Microsoft Access returns an ODBC conformance error if all required columns are not set. To enable your IP to be accessed from Microsoft Access, set all of the columns marked with an asterisk (*) in the following table. Set rest of the columns to null.
If the schema request is mapped to a function call, the cursor opened when information about indexes is returned must match the column sequence and types described in in the following table. Column name is not important but the sequence and data types are.
 
Table 119: Definition of Index Catalog Table OA_STATISTICS 
Column Name
Type
Len
Description
TABLE_QUALIFIER*
WVARCHAR
128
Name of the database in which the table falls. Can be used to distribute tables into physically different databases. We normally use SCHEMA. The entry in here is the same you use in OA_COLUMNS and OA_TABLES.
TABLE_OWNER*
WVARCHAR
128
The owner of the table.
SYSTEM – the table is managed by the owner of the table.
OAUSER – the table is managed by the IP.
TABLE_NAME*
WVARCHAR not NULL
128
Name of the table. This is how the end user will refer to it.
NON_UNIQUE *
SMALLINT
 
Indicates whether the index prohibits duplicate values:
TRUE (1) if the index values can be non-unique.
FALSE (0) if the index values must be unique.
NULL (empty) if TYPE is SQL_TABLE_STAT
INDEX_QUALIFIER
WVARCHAR
128
Name of the database to which the table belongs.
INDEX_NAME*
WVARCHAR
128
Name of the index:
NULL (empty) if TYPE is SQL_TABLE_STAT
OA_TYPE*
SMALLINT not NULL
 
Type of information being returned. Should be set to 1-3 for applications like Microsoft Access to pick up the indexes:
SQL_TABLE_STAT (0) – indicates a statistic for the table
SQL_INDEX_CLUSTERED(1) – indicates a clustered index
SQL_INDEX_HASHED(2) – indicates a hashed index
SQL_INDEX_OTHER(3) – indicates another type of index
SEQ_IN_INDEX*
SMALLINT
 
Column sequence number in index (starting with 1)
Set to NULL if TYPE is SQL_TABLE_STAT. This value is 1 if only one column makes up an index.
COLUMN_NAME*
WVARCHAR
128
Column identifier; set to NULL if TYPE is SQL_TABLE_STAT.
OA_COLLATION
CHAR
1
Collation sequence:
A for ascending
D for descending
NULL if TYPE is SQL_STAT_TABLE or if no collation
OA_CARDINALITY
INTEGER
 
Cardinality of table or index. Used by the DAM to pick an optimal index if this is not a unique index.
number of rows in table if TYPE is SQL_TABLE_STAT
number of unique values in the index if TYPE is not SQL_TABLE_STAT;
NULL if the value is not available from the data source
OA_PAGES
INTEGER
 
Number of pages used to store the index or table. Not used by the OpenAccess SQL engine at this time:
number of pages for the table if TYPE is SQL_TABLE_STAT
number of pages for the index if TYPE is not SQL_TABLE_STAT
NULL if the value is not available from the data source, or if not applicable to the data source.
FILTER_CONDITIONS
WVARCHAR
128
Leave blank to indicate NULL value