Note
This view is available starting with V2.2.30.
Purpose
This view displays the comments of tables and views accessible to the current user.
Applicability
This view is available only in Oracle mode of OceanBase Database.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The owner of the table or view. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the table or view. |
| TABLE_TYPE | VARCHAR2(11) | NO | The type of the object. |
| COMMENTS | VARCHAR2(4000) | NO | The comment on the object. |
Sample query
Query the comments of the STUDENT table accessible to the current user.
obclient [SYS]> SELECT * FROM SYS.ALL_TAB_COMMENTS WHERE TABLE_NAME='STUDENT';
The query result is as follows:
+-------+------------+------------+---------------------------+
| OWNER | TABLE_NAME | TABLE_TYPE | COMMENTS |
+-------+------------+------------+---------------------------+
| SYS | STUDENT | TABLE | student information table |
+-------+------------+------------+---------------------------+
1 row in set
References
Query the comments of all tables and views in the current tenant: DBA_TAB_COMMENTS
Query the comments of all tables and views owned by the current user: USER_TAB_COMMENTS
For more information about how to add comments to a table, see Add comments to schema and non-schema objects.
