ORACLE中給表、列增加註釋以及讀取注釋,oracle注釋

來源:互聯網
上載者:User

ORACLE中給表、列增加註釋以及讀取注釋,oracle注釋

在ORACLE中給表、列增加註釋以及讀取注釋
1、給表填加註釋:SQL>comment on table 表名 is '表注釋";

2、給列加註釋:SQL>comment on column 表.列 is '列注釋';

3、讀取表注釋:SQL>select * from user_tab_comments where comments is not null;

4、讀取列注釋:SQL>select * from user_col_commnents where comments is not null and table_name='表名';

附表USER_TAB_COMMENTS和user_col_comments的結構:

1、user_tab_comments由table_name、table_type和comments三部分組成。

2、user_col_comments由table_name、column_name和comments三部分組成。

3、在SQL*PLUS中顯示表結構:desc 表名;


oracle資料庫中,怎用sql語句給某個欄位添加註釋哇?麻煩知道的人透露下,啦

COMMENT ON COLUMN 表名.列名 IS '注釋內容';
 
oracle資料庫 表的注釋怎在程式中取得?

1.select * from user_col_comments where table_name='表名'

2.select * from USER_TAB_COMMENTS where table_name='表名'

第一個是查欄位注釋,第二個是查表的注釋,表名需要大寫
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.