oracle建立表+注释

建表的时候为了之后查询方便,也为了减小数据库文档的编写,建表最好加上表的注释和列的注释数据库

 

建表语句:文档

CREATE table "TABLE_COUNT"it

(
   "TABLE_NAME"     varchar2(40 char) not null enable,
   "COUNT"          varchar2(40 char) not null enable,
   "DESCRIPTION"    varchar2(40 char) not null enable,
   "FLAG"           varchar2(40 char) not null enable,
   "CREATE_DATE"    varchar2(40 char) not null enable,
   PRIMARY KEY ("TABLE_NAME","CREATE_DATE")
);
comment on table "ZX_COUNT" is '天天产生的业务条数';
comment on column  "ZX_COUNT"."TABLE_NAME"  is '表名';
comment on column  "ZX_COUNT"."COUNT"       is '发生条数';
comment on column  "ZX_COUNT"."DESCRIPTION" is '说明';
comment on column  "ZX_COUNT"."FLAG"        is '类型标记';
comment on column  "ZX_COUNT"."CREATE_DATE" is '业务发生日期';table

commit;;select

 

查询语句:数据

select *from user_tab_comments where table_name='TABLE_COUNT';查询

select *from user_col_comments where table_name='TABLE_COUNT';注释

相关文章
相关标签/搜索