id varchar2(32) primary key,
name VARCHAR2(32) ,
age VARCHAR2(32)
)
COMMENT ON table t1 IS '个人信息'
添加字段注释:
comment on column t1.id is 'id'
comment on column t1.name is '姓名'
comment on column t1.age is '年龄'
表创建完成后使用下列命令添加列的注释:comment on column 表名.字段名 is '注释'表的注释:yang@rac1desc user_col_comments
Name Null? Type
-------------------------- -------- ------------
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
COMMENTS VARCHAR2(4000)
yang@rac1comment on table tchar is ' 这是一个测试表'
Comment created.
yang@rac1select table_name ,comments from user_tab_comments
TABLE_NAME COMMENTS
------------------------------ -----------------------
TCHAR 这是一个测试表
表中字段的注释:
yang@rac1desc user_col_comments
Name Null? Type
------------------------ -------- ----------------------------
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
COMMENTS VARCHAR2(4000)
yang@rac1comment on column tchar.val is ' 测试 来自客户 '
Comment created.
yang@rac1col comments for a45
yang@rac1select comments from user_col_comments where table_name='TCHAR' and column_name='VAL'COMMENTS
测试 来自客户
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)