Note
This view is available starting with V2.2.30.
Purpose
The view displays information about columns in constraints of all tables that the user can access.
Applicability
This view applies only to OceanBase Database in Oracle mode.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The owner of the constraint. |
| CONSTRAINT_NAME | VARCHAR2(128) | NO | The name of the constraint. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the table where the constraint resides. |
| COLUMN_NAME | VARCHAR2(4000) | NO | The name of the column in the constraint. |
| POSITION | NUMBER | NO | The position of the column in the constraint. |
Sample query
Query the information about the columns in the constraints of the TBL3 table in all tables that the user can access.
obclient [SYS]> SELECT * FROM SYS.ALL_CONS_COLUMNS WHERE TABLE_NAME='TBL3';
The query result is as follows:
+-------+----------------------------+------------+-------------+----------+
| OWNER | CONSTRAINT_NAME | TABLE_NAME | COLUMN_NAME | POSITION |
+-------+----------------------------+------------+-------------+----------+
| SYS | TBL3_OBPK_1744012420113641 | TBL3 | COL1 | 1 |
+-------+----------------------------+------------+-------------+----------+
1 row in set
References
USER_CONS_COLUMNS: view the constraint information of all tables owned by the current user.
DBA_CONS_COLUMNS: view the constraint information of all tables in the current tenant.
For more information about constraints, see Define the constraint type for a column.