oracle建立表 注釋

2021-07-24 21:47:20 字數 971 閱讀 8756

建表的時候為了以後查詢方便,也為了減少資料庫文件的編寫,建表最好加上表的注釋和列的注釋

建表語句:

create table "table_count"

("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 '業務發生日期';

commit;;

查詢語句:

select *from user_tab_comments where table_name='table_count';

select *from user_col_comments where table_name='table_count';

oracle 建立表 序列 注釋 主鍵

declare icount number 2 0 begin select count into icount from user sequences u where u.sequence name seq tcapitalnotify if icount 0 then 建立序列 execute ...

oracle 建立表 序列 注釋 主鍵

declare icount number 2 0 begin select count into icount from user sequences u where u.sequence name seq tcapitalnotify if icount 0 then 建立序列 execute ...

Oracle 修改表注釋

修改原欄位名name為name tmp alter table suit ext info rename column inve peri to inve peri tmp 增加乙個和原欄位名同名的字段name alter table suit ext info add inve peri varc...