1、創建表結構
表名: ODS_PSP_DIS_DAY_CALC
create table ODS_PSP_DIS_DAY_CALC
(
ID CHAR(32) NOT NULL,
DISTLIN_ID VARCHAR2(36) NOT NULL,
CALC_DATE DATE,
DISTLINE_NAME VARCHAR2(512),
DISTINE_NO VARCHAR2(100),
INPUT FLOAT,
LINK_TRAN_COUNT NUMBER(6),
ORG_NAME VARCHAR2(200)
);
comment on table ODS_PSP_DIS_DAY_CALC
is '計算結果ODS';
comment on column ODS_PSP_DIS_DAY_CALC .ID
is'唯一標識';
comment on column ODS_PSP_DIS_DAY_CALC .DISTLIN_ID
is '配線的標識';
comment on column ODS_PSP_DIS_DAY_CALC .CALC_DATE
is '日期';
comment on column ODS_PSP_DIS_DAY_CALC .DISTLINE_NAME
is '配電線路名稱';
comment on column ODS_PSP_DIS_DAY_CALC .DISTINE_NO
is '配電線路編碼';
comment on column ODS_PSP_DIS_DAY_CALC .INPUT
is ' 輸入電量(kWh)';
comment on column ODS_PSP_DIS_DAY_CALC .LINK_TRAN_COUNT
is '專變數量';
comment on column ODS_PSP_DIS_DAY_CALC .ORG_NAME
is '單位名稱';
alter table ODS_PSP_DIS_DAY_CALC add constraint XPK_ODS_PSP_DIS_DAY_CALC primary key(ID) using index;
create index IDX_ODS_PSP_DIS_DAY_CALC on ODS_PSP_DIS_DAY_CALC (CALC_DATE);
2、創建臨時表結構
表名:ODS_PSP_DISTLINE_INFO_TEMP
create global temporary table ODS_PSP_DISTLINE_INFO_TEMP
(
id CHAR(32) not null,
distline_id varchar2(36) not null,
calc_date varchar2(20) ,
input float,
public_count number(6)
) on commit preserve rows;
comment on table ODS_PSP_DISTLINE_INFO_TEMP
is '信息臨時表';
comment on column ODS_PSP_DISTLINE_INFO_TEMP.id
is '唯一標識';
comment on column ODS_PSP_DISTLINE_INFO_TEMP.distline_id
is '配電線路標識';
comment on column ODS_PSP_DISTLINE_INFO_TEMP.calc_date
is '日期';
comment on column ODS_PSP_DISTLINE_INFO_TEMP.input
is '輸入電量(kWh)';
comment on column ODS_PSP_DISTLINE_INFO_TEMP.public_count
is '公變數量';
