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 '公变数量';