Note
This view is available starting with V2.2.30.
Purpose
The view displays comments on all columns of views and 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 object. |
| OBJECT_NAME | VARCHAR2(128) | NO | The name of the object. |
| COLUMN_NAME | VARCHAR2(128) | NO | The name of the column. |
| COMMENTS | VARCHAR2(4000) | YES | The comment on the column. |
Sample query
Query all column comments in the T1 table for all tables accessible to the current user.
obclient [SYS]> SELECT * FROM SYS.ALL_COL_COMMENTS WHERE TABLE_NAME='T1';
The query result is as follows:
+-------+------------+----------------+----------+
| OWNER | TABLE_NAME | COLUMN_NAME | COMMENTS |
+-------+------------+----------------+----------+
| SYS | T1 | __pk_increment | NULL |
| SYS | T1 | ID1 | score |
| SYS | T1 | ID2 | NULL |
+-------+------------+----------------+----------+
3 rows in set
References
DBA_COL_COMMENTS shows column comments for all tables and views in the tenant.
USER_COL_COMMENTS shows column comments for all tables and views owned by the current user.