用法如下:
1.对表的说明
comment on table table_name is 'comments_on_tab_information';
2.对表中列的说明
comment on column table.column_name is 'comments_on_col_information';
3.查看表的说明
SQL> select * from user_tab_comments where TABLE_NAME='EMPLOYEES';
4.查看表中列的说明
SQL> select * from user_col_comments where TABLE_NAME='EMPLOYEES';
5.我们也可以从下面这些视图中查看表级和列级说明:
ALL_COL_COMMENTS
USER_COL_COMMENTS
ALL_TAB_COMMENTS
USER_TAB_COMMENTS
6.删除表级说明,也就是将其置为空
SQL> comment on table employees is '';
Comment added
7.删除列级说明,也是将其置为空
SQL> comment on column employees.salary is '';
Comment added
例如:
-追加column
ALTER TABLE VGADB05.TVGAM022 ADD PRINTFLAG VARCHAR(50);
--命名
COMMENT ON COLUMN TVGAM022.PRINTFLAG IS '印刷区分';