Oracle中用comment on命令給表或字段加以說(shuō)明。
用法如下:
1.對(duì)表的說(shuō)明:
comment on table table_name is '對(duì)表的說(shuō)明';
2.對(duì)表中列的說(shuō)明:
comment on column table.column_name is '對(duì)表中列的說(shuō)明';
3.查看表的說(shuō)明
select * from user_tab_comments where table_name = 'employees';
4.查看表中列的說(shuō)明
select * from user_col_comments where table_name = 'employees';
5.查看數(shù)據(jù)庫(kù)中所有表中列的說(shuō)明
select * from user_col_comments where comments is not null;
6.刪除表級(jí)或列級(jí)說(shuō)明格侯,即時(shí)將其設(shè)置為空
comment on table employees is '';
comment on column employees.salary is '';