/在表上添加注释
SCOTT@ora11g>create table test1(name varchar2(30)) tablespace users;
表已创建。
SCOTT@ora11g>insert into test1 values('gqs');
已创建 1 行。
SCOTT@ora11g>commit;
提交完成。
SCOTT@ora11g>comment on table test1 is 'this is a example table!!1';
注释已创建。
SCOTT@ora11g>desc user_tab_comments
名称 是否为空? 类型
----------------------------------------- -------- ---------------------------
TABLE_NAME NOT NULL VARCHAR2(30)
TABLE_TYPE VARCHAR2(11)
COMMENTS VARCHAR2(4000)
SCOTT@ora11g>select COMMENTS from user_tab_comments where table_name='TEST1';
COMMENTS
-------------------------------------------------------------------------------
this is a example table!!1
//在列上添加注释
SCOTT@ora11g> comment on column test1.NAME IS 'THIS is a column!!!' ;
注释已创建。
SCOTT@ora11g>desc user_col_comments
名称 是否为空? 类型
----------------------------------------- -------- -----------------
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
COMMENTS VARCHAR2(4000)
SCOTT@ora11g>select COMMENTS from user_col_comments where TABLE_NAME='TEST1' and
column_name='NAME';
COMMENTS
--------------------------------------------------------------------------------
THIS is a column!!!
SCOTT@ora11g>create table test1(name varchar2(30)) tablespace users;
表已创建。
SCOTT@ora11g>insert into test1 values('gqs');
已创建 1 行。
SCOTT@ora11g>commit;
提交完成。
SCOTT@ora11g>comment on table test1 is 'this is a example table!!1';
注释已创建。
SCOTT@ora11g>desc user_tab_comments
名称 是否为空? 类型
----------------------------------------- -------- ---------------------------
TABLE_NAME NOT NULL VARCHAR2(30)
TABLE_TYPE VARCHAR2(11)
COMMENTS VARCHAR2(4000)
SCOTT@ora11g>select COMMENTS from user_tab_comments where table_name='TEST1';
COMMENTS
-------------------------------------------------------------------------------
this is a example table!!1
//在列上添加注释
SCOTT@ora11g> comment on column test1.NAME IS 'THIS is a column!!!' ;
注释已创建。
SCOTT@ora11g>desc user_col_comments
名称 是否为空? 类型
----------------------------------------- -------- -----------------
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
COMMENTS VARCHAR2(4000)
SCOTT@ora11g>select COMMENTS from user_col_comments where TABLE_NAME='TEST1' and
column_name='NAME';
COMMENTS
--------------------------------------------------------------------------------
THIS is a column!!!