Create Index processing
- Last Updated: May 12, 2026
- 1 minute read
- OpenAccess SDK
- Version 8.1
- Documentation
The SQL syntax for creating an index is:
create_index ::= CREATE [UNIQUE] INDEX index_name ON base_table_name
(column_identifier [ASC | DESC] [,column_identifier...]...)
index_name ::= [index_qualifier.]index_name
When a SQL query of this form is issued, the OpenAccess SDK SQL engine maps this information to a list of schema objects of type damobj_stat. The following table shows how the CREATE INDEX query is mapped to the schema objects.
CREATE INDEX syntax to schema objects mapping
| Schema object properties | CREATE INDEX syntax | Remarks |
| damobj_stat table_qualifier table_owner table_name non_unique = FALSE (if UNIQUE is specified. TRUE Otherwise) index_qualifier index_name seq_in_index = number indicating the sequence of the column in the index. Numbers start at 1 column_name = name of the column collation = 'A' for ASC, 'D' for DESC, '\0' Otherwise |
CREATE [UNIQUE] INDEX index_name ON base_table_name (column_identifier [ASC | DESC]) |
The index information is mapped to a list of schema object of type DAMOBJ_TYPE_STAT. The number of stat objects in the list is based on the number of columns in the CREATE INDEX command. |
When the DDL function in the IP is called, the DDL function should perform the following steps:
-
Get the index definition.
pList = dam_getSchemaObjectList(hstmt, DAMOBJ_TYPE_STAT);damobj_stat pStatObj = dam_getFirstSchemaObject(pList);while ( pStatObj ){/* get the index information from pStatObj */pStatObj = dam_getNextSchemaObject(pList);} -
Use the index information to create an index.