Oracle adds a table comment using the comment statement

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.