Use the Oracle Comment statement to add note information to tables, fields, views, and so on.
the approximate syntax is:
comment on TABLE table_name is ' memo content ';
Permission requirements:
By default, users can only add comments to objects that belong to them.
If you want to add comments to other user objects, you need permission:
COMMENT any TABLE
Related data field views:
user_tab_comments
dba_tab_comments
all_tab_comments
user_col_comments
dba_col_comments
all_col_comments
examples are as follows:
drop table t;
CREATE TABLE T (ID number);
select * from user_tab_comments;
table_name Table_type COMMENTS
------------------------------ ------------------------------ ------------------------------
T TABLE
select * from user_col_comments;
[Email protected]> select * from user_col_comments WHERE table_name= ' T ';
table_name column_name COMMENTS
------------------------------ ------------------------------ ------------------------------
T ID
--Add comments
[email protected]> comment on table t is ' Test table T ';
The comment was created.
[email protected]> comment on column t.id is ' row ID ';
The comment was created.
[Email protected]> select * from user_tab_comments WHERE table_name= ' T ';
table_name Table_type COMMENTS
------------------------------ ------------------------------ ------------------------------
T table Test sheet T
[Email protected]> select * from user_col_comments WHERE table_name= ' T ';
table_name column_name COMMENTS
------------------------------ ------------------------------ ------------------------------
T ID Line ID
For more articles, please refer to: http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_4009.htm#i2119719
Oracle adds a table comment using the comment statement