Purpose
This view displays the index column information of all tables owned by the current user.
Applicability
This view is available starting with OceanBase Database.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| INDEX_NAME | VARCHAR2(128) | NO | The name of the index. |
| TABLE_OWNER | VARCHAR2(128) | NO | The owner of the table to which the index belongs. |
| COLUMN_NAME | VARCHAR2(4000) | NO | The name of the index column. |
| COLUMN_POSITION | NUMBER | NO | The position of the index column in the index. |
| COLUMN_LENGTH | NUMBER | NO | The length of the index column. |
| CHAR_LENGTH | NUMBER | NO | The character length of the index column. |
| DESCEND | VARCHAR2(4) | NO | Indicates whether the index column is sorted in descending (DESC) or ascending (ASC) order. |
Sample query
Query the index column information of the index table TBL2 in all tables owned by the current user.
obclient [SYS]> SELECT * FROM USER_IND_COLUMNS WHERE TABLE_NAME='TBL2';
The query result is as follows:
+--------------------------------+------------+-------------+-----------------+---------------+-------------+---------+--------------------+
| INDEX_NAME | TABLE_NAME | COLUMN_NAME | COLUMN_POSITION | COLUMN_LENGTH | CHAR_LENGTH | DESCEND | COLLATED_COLUMN_ID |
+--------------------------------+------------+-------------+-----------------+---------------+-------------+---------+--------------------+
| TBL2_OBUNIQUE_1737535889306073 | TBL2 | COL1 | 1 | 22 | 0 | ASC | NULL |
| TBL2_IDX1 | TBL2 | COL2 | 1 | 22 | 0 | ASC | NULL |
+--------------------------------+------------+-------------+-----------------+---------------+-------------+---------+--------------------+
2 rows in set