Operate tables and field annotations in oracle

Source: Internet
Author: User

Create a table in oracle for operating tables and field Annotations: [SQL] create table TM_FAULT_BUS_ATTENTION (BUS_NO NUMBER (6), LINE_NO VARCHAR2 (6), FILA_NO NUMBER (3 ), BUS_JOB_NO VARCHAR2 (20) not null, CITY_NO NUMBER (4), GROUP_NO NUMBER (4), INS_TIME DATE, IS_SEND NUMBER (1) default 1 ); [SQL] -- Add comments to the table comment on table TM_FAULT_BUS_ATTENTION is 'add vehicle faulty information'; -- Add comments to the columns comment on column TM_FAULT _ BUS_ATTENTION.BUS_NO is 'Vehicle No. '; comment on column comment is 'line No.'; comment on column TM_FAULT_BUS_ATTENTION.FILA_NO is 'Company No. '; comment on column comment is 'Vehicle No '; comment on column comment is 'region'; comment on column TM_FAULT_BUS_ATTENTION.GROUP_NO is 'motorcade '; comment on column TM_FAULT_BUS_ATTENTION.INS_TIME is 'Download time'; comment on Column TM_FAULT_BUS_ATTENTION.IS_SEND is 'sent? '. After the remarks are added, how can I query them? Query table comment information: [SQL] SELECT TABLE_NAME, TABLE_TYPE, comments from USER_TAB_COMMENTS WHERE TABLE_NAME = 'Tm _ FAULT_BUS_ATTENTION '; query table field comment information: [SQL] SELECT TABLE_NAME, COLUMN_NAME, comments from USER_COL_COMMENTS WHERE TABLE_NAME = 'Tm _ FAULT_BUS_ATTENTION '; comment on a field in the query table as follows: [SQL] select comments from USER_COL_COMMENTS where table_name = 'Tm _ FAULT_BUS_ATTENTION 'and column_name = 'line _ no' Note: Table Name, field name should 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.