Add and read comments to tables and columns in ORACLE

Source: Internet
Author: User

Add and read comments to tables and columns in ORACLE

Add and read comments to tables and columns in ORACLE
1. Add a comment to the table: SQL> comment on table name is 'table comment ";

2. Add a comment to the column: SQL> comment on column table. The column is 'column annotation ';

3. read Table comments: SQL> select * from user_tab_comments where comments is not null;

4. Read the column comment: SQL> select * from user_col_commnents where comments is not null and table_name = 'table name ';

The structure of USER_TAB_COMMENTS and user_col_comments in the appendix:

1. user_tab_comments consists of three parts: table_name, table_type, and comments.

2. user_col_comments consists of three parts: table_name, column_name, and comments.

3. display the table structure in SQL * PLUS: desc table name;

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.