Purpose
This view displays comments on tables and views owned by the current user.
Applicability
This view is available starting with OceanBase Database.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| 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 comment on the table T1 in the current user's schema.
obclient [SYS]> SELECT * FROM SYS.USER_TAB_COMMENTS WHERE TABLE_NAME='T1';
The query result is as follows:
+------------+------------+------------+
| TABLE_NAME | TABLE_TYPE | COMMENTS |
+------------+------------+------------+
| T1 | TABLE | test table |
+------------+------------+------------+
1 row in set
References
Query comments on all tables and views accessible to the current user: ALL_TAB_COMMENTS
Query comments on all tables and views in the current tenant: DBA_TAB_COMMENTS
For more information about how to add comments to a table, see Comment on schema and non-schema objects.