標籤:style blog color 資料 re c div ar
-- 建立表create table SX04_LBALANCE( YEAR VARCHAR2(10) not null, PROGRAMNO VARCHAR2(40) not null, FDATE VARCHAR2(10) not null, FACCTCODE VARCHAR2(50) not null, FCURCODE VARCHAR2(3) not null, FAACCCREDIT NUMBER(19,4) default 0 not null, FAENDBAL NUMBER(19,4) default 0 not null, FISDETAIL NUMBER(3) not null)--表所在資料表空間tablespace ISTAUDIT pctfree 10 initrans 1 maxtrans 255 storage ( initial 152M minextents 1 maxextents unlimited );-- 欄位描述comment on column SX04_LBALANCE.INPUT_DT is ‘資料日期‘;-- 添加主鍵alter table SX04_LBALANCE add primary key (YEAR, PROGRAMNO, FACCTCODE, FDATE) using index tablespace ISTAUDIT pctfree 10 initrans 2 maxtrans 255 storage ( initial 93M minextents 1 maxextents unlimited );-- 建立索引 多個索引可連續建立 如下create index CODE_INDEX on SX04_LBALANCE (FACCTCODE) tablespace ISTAUDIT pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited );create index FDATE_INDEX on SX04_LBALANCE (FDATE) tablespace ISTAUDIT pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited );