通过设置模板来设置。
创新互联是一家专注于成都做网站、成都网站建设与策划设计,青山网站建设哪家好?创新互联做网站,专注于网站建设10多年,网设计领域的专业建站公司;建站业务涵盖:青山等地区。青山做网站价格咨询:028-86922220
在ORACLE中给表列增加注释以及读取注释,给表填加注释:SQLcommentonable表名is表注释,给列加注释:SQLcommentoncolumn表.列is列注释,读取表注释:SQLselect*fromuser_tab_commentswherecommentsisnotnull,读取列注释:SQLselect*fromuser_col_commnentswherecommentsisnotnullandable_name='表名。
表创建完成后使用下列命令添加列的注释:
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
测试 来自客户
Oracle添加注释的语法为:
comment on column 字段名 is '注释名';
举例:
创建表:
CREATE TABLE t1(
id varchar2(32) primary key,
name VARCHAR2(8) NOT NULL,
age number,
);
添加表注释:
COMMENT ON table t1 IS '个人信息';
添加字段注释:
comment on column t1.id is 'id';
comment on column t1.name is '姓名';
comment on column t1.age is '年龄';
CREATE TABLE t1(
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 '年龄';