Add and read comments and ORACLE comments to tables and columns in oracle

Source: Internet
Author: User

Add and read comments and ORACLE 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;


In oracle databases, how do I add comments to a field using SQL statements? People who need to know the details are disclosed.

Comment on column table name. COLUMN name IS 'comment content ';

How can I obtain the annotation of an oracle database table in a program?

1. select * from user_col_comments where table_name = 'table name'

2. select * from USER_TAB_COMMENTS where table_name = 'table name'

The first is to query field comments, the second is the comments of the table, and the table name must be capitalized.

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.