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='表名'

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

相關文章

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.