




DROP MATERIALIZED VIEW WVIEW0031_YYYYMM;
DROP TABLE WVIEW0031_YYYYMM PURGE;

CREATE TABLE WVIEW0031_YYYYMM
(
VPERIOD VARCHAR2(9) NOT NULL
, VKEY1 VARCHAR2(60) NOT NULL
, VKEY2 VARCHAR2(60) NOT NULL
, VKEY3 VARCHAR2(60) NOT NULL
, VKEY4 VARCHAR2(60) NOT NULL
, VKEY5 VARCHAR2(60) NOT NULL
, VKEY6 VARCHAR2(60) NOT NULL
, VKEY7 VARCHAR2(60) NOT NULL
, VKEY8 VARCHAR2(60) NOT NULL
, VKEY9 VARCHAR2(60) NOT NULL
, VKEY10 VARCHAR2(60) NOT NULL
, VKEY11 VARCHAR2(60) NOT NULL
, VKEY12 VARCHAR2(60) NOT NULL
, VKEY13 VARCHAR2(60) NOT NULL
, VKEY14 VARCHAR2(60) NOT NULL
, VKEY15 VARCHAR2(60) NOT NULL
, VKEY16 VARCHAR2(60) NOT NULL
, VKEY17 VARCHAR2(60) NOT NULL
, VKEY18 VARCHAR2(60) NOT NULL
, VKEY19 VARCHAR2(60) NOT NULL
, VKEY20 VARCHAR2(60) NOT NULL
, VKEY21 VARCHAR2(60) NOT NULL
, VKEY22 VARCHAR2(60) NOT NULL
, VKEY23 VARCHAR2(60) NOT NULL
, VKEY24 VARCHAR2(60) NOT NULL
, VKEY25 VARCHAR2(60) NOT NULL
, VKEY26 VARCHAR2(60) NOT NULL
, VKEY27 VARCHAR2(60) NOT NULL
, VKEY28 VARCHAR2(60) NOT NULL
, VKEY29 VARCHAR2(60) NOT NULL
, VKEY30 VARCHAR2(60) NOT NULL
, VKEY31 VARCHAR2(60) NOT NULL
, VKEY32 VARCHAR2(60) NOT NULL
, VKEY33 VARCHAR2(60) NOT NULL
, VKEY34 VARCHAR2(60) NOT NULL
, VKEY35 VARCHAR2(60) NOT NULL
, VKEY36 VARCHAR2(60) NOT NULL
, VKEY37 VARCHAR2(60) NOT NULL
, VKEY38 VARCHAR2(60) NOT NULL
, VKEY39 VARCHAR2(60) NOT NULL
, VKEY40 VARCHAR2(60) NOT NULL
, VKEY41 VARCHAR2(60) NOT NULL
, VKEY42 VARCHAR2(60) NOT NULL
, VKEY43 VARCHAR2(60) NOT NULL
, VKEY44 VARCHAR2(60) NOT NULL
, VKEY45 VARCHAR2(60) NOT NULL
, VKEY46 VARCHAR2(60) NOT NULL
, VKEY47 VARCHAR2(60) NOT NULL
, VKEY48 VARCHAR2(60) NOT NULL
, VKEY49 VARCHAR2(60) NOT NULL
, VKEY50 VARCHAR2(60) NOT NULL
, VKEY51 VARCHAR2(60) NOT NULL
, VKEY52 VARCHAR2(60) NOT NULL
, VKEY53 VARCHAR2(60) NOT NULL
, VKEY54 VARCHAR2(60) NOT NULL
, VKEY55 VARCHAR2(60) NOT NULL
, VKEY56 VARCHAR2(60) NOT NULL
, VKEY57 VARCHAR2(60) NOT NULL
, VKEY58 VARCHAR2(60) NOT NULL
, VKEY59 VARCHAR2(60) NOT NULL
, VKEY60 VARCHAR2(60) NOT NULL
, VD1 NUMBER
, VD2 NUMBER
, VD3 NUMBER
, VD4 NUMBER
, VD5 NUMBER
, VD6 NUMBER
, VD7 NUMBER
, VD8 NUMBER
, VD9 NUMBER
, VD10 NUMBER
, VD11 NUMBER
, VD12 NUMBER
, VD13 NUMBER
, VD14 NUMBER
, VD15 NUMBER
, VD16 NUMBER
, VD17 NUMBER
, VD18 NUMBER
, VD19 NUMBER
, VD20 NUMBER
, VD21 NUMBER
, VD22 NUMBER
, VD23 NUMBER
, VD24 NUMBER
, VD25 NUMBER
, VD26 NUMBER
, VD27 NUMBER
, VD28 NUMBER
, VD29 NUMBER
, VD30 NUMBER
, VD31 NUMBER
, VD32 NUMBER
, VD33 NUMBER
, VD34 NUMBER
, VD35 NUMBER
, VD36 NUMBER
, VD37 NUMBER
, VD38 NUMBER
, VD39 NUMBER
, VD40 NUMBER
, VD41 NUMBER
, VD42 NUMBER
, VD43 NUMBER
, VD44 NUMBER
, VD45 NUMBER
, VD46 NUMBER
, VD47 NUMBER
, VD48 NUMBER
, VD49 NUMBER
, VD50 NUMBER
, VD51 NUMBER
, VD52 NUMBER
, VD53 NUMBER
, VD54 NUMBER
, VD55 NUMBER
, VD56 NUMBER
, VD57 NUMBER
, VD58 NUMBER
, VD59 NUMBER
, VD60 NUMBER
, VKEYP NUMBER
)
NOLOGGING
;
INSERT /*+ APPEND */ INTO WVIEW0031_YYYYMM
SELECT T0.*, ROWNUM "VKEYP" FROM (SELECT
C.EX_YYYYMM "VPERIOD"
,A.VKEY1 "VKEY1"
,A.VKEY2 "VKEY2"
,A.VKEY3 "VKEY3"
,A.VKEY4 "VKEY4"
,A.VKEY5 "VKEY5"
,A.VKEY6 "VKEY6"
,A.VKEY7 "VKEY7"
,A.VKEY8 "VKEY8"
,A.VKEY9 "VKEY9"
,A.VKEY10 "VKEY10"
,A.VKEY11 "VKEY11"
,A.VKEY12 "VKEY12"
,A.VKEY13 "VKEY13"
,A.VKEY14 "VKEY14"
,A.VKEY15 "VKEY15"
,A.VKEY16 "VKEY16"
,A.VKEY17 "VKEY17"
,A.VKEY18 "VKEY18"
,A.VKEY19 "VKEY19"
,A.VKEY20 "VKEY20"
,A.VKEY21 "VKEY21"
,A.VKEY22 "VKEY22"
,A.VKEY23 "VKEY23"
,A.VKEY24 "VKEY24"
,A.VKEY25 "VKEY25"
,A.VKEY26 "VKEY26"
,A.VKEY27 "VKEY27"
,A.VKEY28 "VKEY28"
,A.VKEY29 "VKEY29"
,A.VKEY30 "VKEY30"
,A.VKEY31 "VKEY31"
,A.VKEY32 "VKEY32"
,A.VKEY33 "VKEY33"
,A.VKEY34 "VKEY34"
,A.VKEY35 "VKEY35"
,A.VKEY36 "VKEY36"
,A.VKEY37 "VKEY37"
,A.VKEY38 "VKEY38"
,A.VKEY39 "VKEY39"
,A.VKEY40 "VKEY40"
,A.VKEY41 "VKEY41"
,A.VKEY42 "VKEY42"
,A.VKEY43 "VKEY43"
,A.VKEY44 "VKEY44"
,A.VKEY45 "VKEY45"
,A.VKEY46 "VKEY46"
,A.VKEY47 "VKEY47"
,A.VKEY48 "VKEY48"
,A.VKEY49 "VKEY49"
,A.VKEY50 "VKEY50"
,A.VKEY51 "VKEY51"
,A.VKEY52 "VKEY52"
,A.VKEY53 "VKEY53"
,A.VKEY54 "VKEY54"
,A.VKEY55 "VKEY55"
,A.VKEY56 "VKEY56"
,A.VKEY57 "VKEY57"
,A.VKEY58 "VKEY58"
,A.VKEY59 "VKEY59"
,A.VKEY60 "VKEY60"
,SUM(A.VD1) "VD1"
,SUM(A.VD2) "VD2"
,SUM(A.VD3) "VD3"
,SUM(A.VD4) "VD4"
,SUM(A.VD5) "VD5"
,SUM(A.VD6) "VD6"
,SUM(A.VD7) "VD7"
,SUM(A.VD8) "VD8"
,SUM(A.VD9) "VD9"
,SUM(A.VD10) "VD10"
,SUM(A.VD11) "VD11"
,SUM(A.VD12) "VD12"
,SUM(A.VD13) "VD13"
,SUM(A.VD14) "VD14"
,SUM(A.VD15) "VD15"
,SUM(A.VD16) "VD16"
,SUM(A.VD17) "VD17"
,SUM(A.VD18) "VD18"
,SUM(A.VD19) "VD19"
,SUM(A.VD20) "VD20"
,SUM(A.VD21) "VD21"
,SUM(A.VD22) "VD22"
,SUM(A.VD23) "VD23"
,SUM(A.VD24) "VD24"
,SUM(A.VD25) "VD25"
,SUM(A.VD26) "VD26"
,SUM(A.VD27) "VD27"
,SUM(A.VD28) "VD28"
,SUM(A.VD29) "VD29"
,SUM(A.VD30) "VD30"
,SUM(A.VD31) "VD31"
,SUM(A.VD32) "VD32"
,SUM(A.VD33) "VD33"
,SUM(A.VD34) "VD34"
,SUM(A.VD35) "VD35"
,SUM(A.VD36) "VD36"
,SUM(A.VD37) "VD37"
,SUM(A.VD38) "VD38"
,SUM(A.VD39) "VD39"
,SUM(A.VD40) "VD40"
,SUM(A.VD41) "VD41"
,SUM(A.VD42) "VD42"
,SUM(A.VD43) "VD43"
,SUM(A.VD44) "VD44"
,SUM(A.VD45) "VD45"
,SUM(A.VD46) "VD46"
,SUM(A.VD47) "VD47"
,SUM(A.VD48) "VD48"
,SUM(A.VD49) "VD49"
,SUM(A.VD50) "VD50"
,SUM(A.VD51) "VD51"
,SUM(A.VD52) "VD52"
,SUM(A.VD53) "VD53"
,SUM(A.VD54) "VD54"
,SUM(A.VD55) "VD55"
,SUM(A.VD56) "VD56"
,SUM(A.VD57) "VD57"
,SUM(A.VD58) "VD58"
,SUM(A.VD59) "VD59"
,SUM(A.VD60) "VD60"
FROM WVIEW0031_TENDAYS A
INNER JOIN EX_PERIOD B ON B.EX_PERIOD_ID='P' AND B.EX_PERIOD = A.VPERIOD
INNER JOIN EX_DAY C ON B.EX_START = C.EX_DATE
GROUP BY
C.EX_YYYYMM
,A.VKEY1
,A.VKEY2
,A.VKEY3
,A.VKEY4
,A.VKEY5
,A.VKEY6
,A.VKEY7
,A.VKEY8
,A.VKEY9
,A.VKEY10
,A.VKEY11
,A.VKEY12
,A.VKEY13
,A.VKEY14
,A.VKEY15
,A.VKEY16
,A.VKEY17
,A.VKEY18
,A.VKEY19
,A.VKEY20
,A.VKEY21
,A.VKEY22
,A.VKEY23
,A.VKEY24
,A.VKEY25
,A.VKEY26
,A.VKEY27
,A.VKEY28
,A.VKEY29
,A.VKEY30
,A.VKEY31
,A.VKEY32
,A.VKEY33
,A.VKEY34
,A.VKEY35
,A.VKEY36
,A.VKEY37
,A.VKEY38
,A.VKEY39
,A.VKEY40
,A.VKEY41
,A.VKEY42
,A.VKEY43
,A.VKEY44
,A.VKEY45
,A.VKEY46
,A.VKEY47
,A.VKEY48
,A.VKEY49
,A.VKEY50
,A.VKEY51
,A.VKEY52
,A.VKEY53
,A.VKEY54
,A.VKEY55
,A.VKEY56
,A.VKEY57
,A.VKEY58
,A.VKEY59
,A.VKEY60
) T0;
ALTER TABLE WVIEW0031_YYYYMM ADD PRIMARY KEY
(
VKEYP
)
NOLOGGING
;


CREATE INDEX IDX_WVIEW0031_YYYYMM_1
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY1
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_2
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY2
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_3
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY3
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_4
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY4
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_5
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY5
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_6
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY6
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_7
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY7
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_8
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY8
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_9
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY9
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_10
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY10
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_11
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY11
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_12
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY12
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_13
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY13
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_14
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY14
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_15
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY15
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_16
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY16
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_17
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY17
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_18
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY18
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_19
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY19
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_20
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY20
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_21
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY21
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_22
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY22
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_23
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY23
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_24
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY24
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_25
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY25
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_26
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY26
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_27
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY27
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_28
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY28
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYYMM_29
ON WVIEW0031_YYYYMM
(
VPERIOD
,VKEY29
)
NOLOGGING
;


COMMIT;


DROP MATERIALIZED VIEW WVIEW0031_TERM;
DROP TABLE WVIEW0031_TERM PURGE;

CREATE TABLE WVIEW0031_TERM
(
VPERIOD VARCHAR2(9) NOT NULL
, VKEY1 VARCHAR2(60) NOT NULL
, VKEY2 VARCHAR2(60) NOT NULL
, VKEY3 VARCHAR2(60) NOT NULL
, VKEY4 VARCHAR2(60) NOT NULL
, VKEY5 VARCHAR2(60) NOT NULL
, VKEY6 VARCHAR2(60) NOT NULL
, VKEY7 VARCHAR2(60) NOT NULL
, VKEY8 VARCHAR2(60) NOT NULL
, VKEY9 VARCHAR2(60) NOT NULL
, VKEY10 VARCHAR2(60) NOT NULL
, VKEY11 VARCHAR2(60) NOT NULL
, VKEY12 VARCHAR2(60) NOT NULL
, VKEY13 VARCHAR2(60) NOT NULL
, VKEY14 VARCHAR2(60) NOT NULL
, VKEY15 VARCHAR2(60) NOT NULL
, VKEY16 VARCHAR2(60) NOT NULL
, VKEY17 VARCHAR2(60) NOT NULL
, VKEY18 VARCHAR2(60) NOT NULL
, VKEY19 VARCHAR2(60) NOT NULL
, VKEY20 VARCHAR2(60) NOT NULL
, VKEY21 VARCHAR2(60) NOT NULL
, VKEY22 VARCHAR2(60) NOT NULL
, VKEY23 VARCHAR2(60) NOT NULL
, VKEY24 VARCHAR2(60) NOT NULL
, VKEY25 VARCHAR2(60) NOT NULL
, VKEY26 VARCHAR2(60) NOT NULL
, VKEY27 VARCHAR2(60) NOT NULL
, VKEY28 VARCHAR2(60) NOT NULL
, VKEY29 VARCHAR2(60) NOT NULL
, VKEY30 VARCHAR2(60) NOT NULL
, VKEY31 VARCHAR2(60) NOT NULL
, VKEY32 VARCHAR2(60) NOT NULL
, VKEY33 VARCHAR2(60) NOT NULL
, VKEY34 VARCHAR2(60) NOT NULL
, VKEY35 VARCHAR2(60) NOT NULL
, VKEY36 VARCHAR2(60) NOT NULL
, VKEY37 VARCHAR2(60) NOT NULL
, VKEY38 VARCHAR2(60) NOT NULL
, VKEY39 VARCHAR2(60) NOT NULL
, VKEY40 VARCHAR2(60) NOT NULL
, VKEY41 VARCHAR2(60) NOT NULL
, VKEY42 VARCHAR2(60) NOT NULL
, VKEY43 VARCHAR2(60) NOT NULL
, VKEY44 VARCHAR2(60) NOT NULL
, VKEY45 VARCHAR2(60) NOT NULL
, VKEY46 VARCHAR2(60) NOT NULL
, VKEY47 VARCHAR2(60) NOT NULL
, VKEY48 VARCHAR2(60) NOT NULL
, VKEY49 VARCHAR2(60) NOT NULL
, VKEY50 VARCHAR2(60) NOT NULL
, VKEY51 VARCHAR2(60) NOT NULL
, VKEY52 VARCHAR2(60) NOT NULL
, VKEY53 VARCHAR2(60) NOT NULL
, VKEY54 VARCHAR2(60) NOT NULL
, VKEY55 VARCHAR2(60) NOT NULL
, VKEY56 VARCHAR2(60) NOT NULL
, VKEY57 VARCHAR2(60) NOT NULL
, VKEY58 VARCHAR2(60) NOT NULL
, VKEY59 VARCHAR2(60) NOT NULL
, VKEY60 VARCHAR2(60) NOT NULL
, VD1 NUMBER
, VD2 NUMBER
, VD3 NUMBER
, VD4 NUMBER
, VD5 NUMBER
, VD6 NUMBER
, VD7 NUMBER
, VD8 NUMBER
, VD9 NUMBER
, VD10 NUMBER
, VD11 NUMBER
, VD12 NUMBER
, VD13 NUMBER
, VD14 NUMBER
, VD15 NUMBER
, VD16 NUMBER
, VD17 NUMBER
, VD18 NUMBER
, VD19 NUMBER
, VD20 NUMBER
, VD21 NUMBER
, VD22 NUMBER
, VD23 NUMBER
, VD24 NUMBER
, VD25 NUMBER
, VD26 NUMBER
, VD27 NUMBER
, VD28 NUMBER
, VD29 NUMBER
, VD30 NUMBER
, VD31 NUMBER
, VD32 NUMBER
, VD33 NUMBER
, VD34 NUMBER
, VD35 NUMBER
, VD36 NUMBER
, VD37 NUMBER
, VD38 NUMBER
, VD39 NUMBER
, VD40 NUMBER
, VD41 NUMBER
, VD42 NUMBER
, VD43 NUMBER
, VD44 NUMBER
, VD45 NUMBER
, VD46 NUMBER
, VD47 NUMBER
, VD48 NUMBER
, VD49 NUMBER
, VD50 NUMBER
, VD51 NUMBER
, VD52 NUMBER
, VD53 NUMBER
, VD54 NUMBER
, VD55 NUMBER
, VD56 NUMBER
, VD57 NUMBER
, VD58 NUMBER
, VD59 NUMBER
, VD60 NUMBER
, VKEYP NUMBER
)
NOLOGGING
;
INSERT /*+ APPEND */ INTO WVIEW0031_TERM
SELECT T0.*, ROWNUM "VKEYP" FROM (SELECT
C.EX_TERM "VPERIOD"
,A.VKEY1 "VKEY1"
,A.VKEY2 "VKEY2"
,A.VKEY3 "VKEY3"
,A.VKEY4 "VKEY4"
,A.VKEY5 "VKEY5"
,A.VKEY6 "VKEY6"
,A.VKEY7 "VKEY7"
,A.VKEY8 "VKEY8"
,A.VKEY9 "VKEY9"
,A.VKEY10 "VKEY10"
,A.VKEY11 "VKEY11"
,A.VKEY12 "VKEY12"
,A.VKEY13 "VKEY13"
,A.VKEY14 "VKEY14"
,A.VKEY15 "VKEY15"
,A.VKEY16 "VKEY16"
,A.VKEY17 "VKEY17"
,A.VKEY18 "VKEY18"
,A.VKEY19 "VKEY19"
,A.VKEY20 "VKEY20"
,A.VKEY21 "VKEY21"
,A.VKEY22 "VKEY22"
,A.VKEY23 "VKEY23"
,A.VKEY24 "VKEY24"
,A.VKEY25 "VKEY25"
,A.VKEY26 "VKEY26"
,A.VKEY27 "VKEY27"
,A.VKEY28 "VKEY28"
,A.VKEY29 "VKEY29"
,A.VKEY30 "VKEY30"
,A.VKEY31 "VKEY31"
,A.VKEY32 "VKEY32"
,A.VKEY33 "VKEY33"
,A.VKEY34 "VKEY34"
,A.VKEY35 "VKEY35"
,A.VKEY36 "VKEY36"
,A.VKEY37 "VKEY37"
,A.VKEY38 "VKEY38"
,A.VKEY39 "VKEY39"
,A.VKEY40 "VKEY40"
,A.VKEY41 "VKEY41"
,A.VKEY42 "VKEY42"
,A.VKEY43 "VKEY43"
,A.VKEY44 "VKEY44"
,A.VKEY45 "VKEY45"
,A.VKEY46 "VKEY46"
,A.VKEY47 "VKEY47"
,A.VKEY48 "VKEY48"
,A.VKEY49 "VKEY49"
,A.VKEY50 "VKEY50"
,A.VKEY51 "VKEY51"
,A.VKEY52 "VKEY52"
,A.VKEY53 "VKEY53"
,A.VKEY54 "VKEY54"
,A.VKEY55 "VKEY55"
,A.VKEY56 "VKEY56"
,A.VKEY57 "VKEY57"
,A.VKEY58 "VKEY58"
,A.VKEY59 "VKEY59"
,A.VKEY60 "VKEY60"
,SUM(A.VD1) "VD1"
,SUM(A.VD2) "VD2"
,SUM(A.VD3) "VD3"
,SUM(A.VD4) "VD4"
,SUM(A.VD5) "VD5"
,SUM(A.VD6) "VD6"
,SUM(A.VD7) "VD7"
,SUM(A.VD8) "VD8"
,SUM(A.VD9) "VD9"
,SUM(A.VD10) "VD10"
,SUM(A.VD11) "VD11"
,SUM(A.VD12) "VD12"
,SUM(A.VD13) "VD13"
,SUM(A.VD14) "VD14"
,SUM(A.VD15) "VD15"
,SUM(A.VD16) "VD16"
,SUM(A.VD17) "VD17"
,SUM(A.VD18) "VD18"
,SUM(A.VD19) "VD19"
,SUM(A.VD20) "VD20"
,SUM(A.VD21) "VD21"
,SUM(A.VD22) "VD22"
,SUM(A.VD23) "VD23"
,SUM(A.VD24) "VD24"
,SUM(A.VD25) "VD25"
,SUM(A.VD26) "VD26"
,SUM(A.VD27) "VD27"
,SUM(A.VD28) "VD28"
,SUM(A.VD29) "VD29"
,SUM(A.VD30) "VD30"
,SUM(A.VD31) "VD31"
,SUM(A.VD32) "VD32"
,SUM(A.VD33) "VD33"
,SUM(A.VD34) "VD34"
,SUM(A.VD35) "VD35"
,SUM(A.VD36) "VD36"
,SUM(A.VD37) "VD37"
,SUM(A.VD38) "VD38"
,SUM(A.VD39) "VD39"
,SUM(A.VD40) "VD40"
,SUM(A.VD41) "VD41"
,SUM(A.VD42) "VD42"
,SUM(A.VD43) "VD43"
,SUM(A.VD44) "VD44"
,SUM(A.VD45) "VD45"
,SUM(A.VD46) "VD46"
,SUM(A.VD47) "VD47"
,SUM(A.VD48) "VD48"
,SUM(A.VD49) "VD49"
,SUM(A.VD50) "VD50"
,SUM(A.VD51) "VD51"
,SUM(A.VD52) "VD52"
,SUM(A.VD53) "VD53"
,SUM(A.VD54) "VD54"
,SUM(A.VD55) "VD55"
,SUM(A.VD56) "VD56"
,SUM(A.VD57) "VD57"
,SUM(A.VD58) "VD58"
,SUM(A.VD59) "VD59"
,SUM(A.VD60) "VD60"
FROM WVIEW0031_YYYYMM A
INNER JOIN EX_PERIOD B ON B.EX_PERIOD_ID='M' AND B.EX_PERIOD = A.VPERIOD
INNER JOIN EX_DAY C ON B.EX_START = C.EX_DATE
GROUP BY
C.EX_TERM
,A.VKEY1
,A.VKEY2
,A.VKEY3
,A.VKEY4
,A.VKEY5
,A.VKEY6
,A.VKEY7
,A.VKEY8
,A.VKEY9
,A.VKEY10
,A.VKEY11
,A.VKEY12
,A.VKEY13
,A.VKEY14
,A.VKEY15
,A.VKEY16
,A.VKEY17
,A.VKEY18
,A.VKEY19
,A.VKEY20
,A.VKEY21
,A.VKEY22
,A.VKEY23
,A.VKEY24
,A.VKEY25
,A.VKEY26
,A.VKEY27
,A.VKEY28
,A.VKEY29
,A.VKEY30
,A.VKEY31
,A.VKEY32
,A.VKEY33
,A.VKEY34
,A.VKEY35
,A.VKEY36
,A.VKEY37
,A.VKEY38
,A.VKEY39
,A.VKEY40
,A.VKEY41
,A.VKEY42
,A.VKEY43
,A.VKEY44
,A.VKEY45
,A.VKEY46
,A.VKEY47
,A.VKEY48
,A.VKEY49
,A.VKEY50
,A.VKEY51
,A.VKEY52
,A.VKEY53
,A.VKEY54
,A.VKEY55
,A.VKEY56
,A.VKEY57
,A.VKEY58
,A.VKEY59
,A.VKEY60
) T0;
ALTER TABLE WVIEW0031_TERM ADD PRIMARY KEY
(
VKEYP
)
NOLOGGING
;



CREATE INDEX IDX_WVIEW0031_TERM_1
ON WVIEW0031_TERM
(
VPERIOD
,VKEY1
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_2
ON WVIEW0031_TERM
(
VPERIOD
,VKEY2
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_3
ON WVIEW0031_TERM
(
VPERIOD
,VKEY3
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_4
ON WVIEW0031_TERM
(
VPERIOD
,VKEY4
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_5
ON WVIEW0031_TERM
(
VPERIOD
,VKEY5
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_6
ON WVIEW0031_TERM
(
VPERIOD
,VKEY6
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_7
ON WVIEW0031_TERM
(
VPERIOD
,VKEY7
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_8
ON WVIEW0031_TERM
(
VPERIOD
,VKEY8
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_9
ON WVIEW0031_TERM
(
VPERIOD
,VKEY9
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_10
ON WVIEW0031_TERM
(
VPERIOD
,VKEY10
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_11
ON WVIEW0031_TERM
(
VPERIOD
,VKEY11
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_12
ON WVIEW0031_TERM
(
VPERIOD
,VKEY12
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_13
ON WVIEW0031_TERM
(
VPERIOD
,VKEY13
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_14
ON WVIEW0031_TERM
(
VPERIOD
,VKEY14
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_15
ON WVIEW0031_TERM
(
VPERIOD
,VKEY15
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_16
ON WVIEW0031_TERM
(
VPERIOD
,VKEY16
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_17
ON WVIEW0031_TERM
(
VPERIOD
,VKEY17
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_18
ON WVIEW0031_TERM
(
VPERIOD
,VKEY18
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_19
ON WVIEW0031_TERM
(
VPERIOD
,VKEY19
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_20
ON WVIEW0031_TERM
(
VPERIOD
,VKEY20
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_21
ON WVIEW0031_TERM
(
VPERIOD
,VKEY21
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_22
ON WVIEW0031_TERM
(
VPERIOD
,VKEY22
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_23
ON WVIEW0031_TERM
(
VPERIOD
,VKEY23
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_24
ON WVIEW0031_TERM
(
VPERIOD
,VKEY24
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_25
ON WVIEW0031_TERM
(
VPERIOD
,VKEY25
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_26
ON WVIEW0031_TERM
(
VPERIOD
,VKEY26
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_27
ON WVIEW0031_TERM
(
VPERIOD
,VKEY27
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_28
ON WVIEW0031_TERM
(
VPERIOD
,VKEY28
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_TERM_29
ON WVIEW0031_TERM
(
VPERIOD
,VKEY29
)
NOLOGGING
;


COMMIT;


DROP MATERIALIZED VIEW WVIEW0031_HALFYEAR;
DROP TABLE WVIEW0031_HALFYEAR PURGE;

CREATE TABLE WVIEW0031_HALFYEAR
(
VPERIOD VARCHAR2(9) NOT NULL
, VKEY1 VARCHAR2(60) NOT NULL
, VKEY2 VARCHAR2(60) NOT NULL
, VKEY3 VARCHAR2(60) NOT NULL
, VKEY4 VARCHAR2(60) NOT NULL
, VKEY5 VARCHAR2(60) NOT NULL
, VKEY6 VARCHAR2(60) NOT NULL
, VKEY7 VARCHAR2(60) NOT NULL
, VKEY8 VARCHAR2(60) NOT NULL
, VKEY9 VARCHAR2(60) NOT NULL
, VKEY10 VARCHAR2(60) NOT NULL
, VKEY11 VARCHAR2(60) NOT NULL
, VKEY12 VARCHAR2(60) NOT NULL
, VKEY13 VARCHAR2(60) NOT NULL
, VKEY14 VARCHAR2(60) NOT NULL
, VKEY15 VARCHAR2(60) NOT NULL
, VKEY16 VARCHAR2(60) NOT NULL
, VKEY17 VARCHAR2(60) NOT NULL
, VKEY18 VARCHAR2(60) NOT NULL
, VKEY19 VARCHAR2(60) NOT NULL
, VKEY20 VARCHAR2(60) NOT NULL
, VKEY21 VARCHAR2(60) NOT NULL
, VKEY22 VARCHAR2(60) NOT NULL
, VKEY23 VARCHAR2(60) NOT NULL
, VKEY24 VARCHAR2(60) NOT NULL
, VKEY25 VARCHAR2(60) NOT NULL
, VKEY26 VARCHAR2(60) NOT NULL
, VKEY27 VARCHAR2(60) NOT NULL
, VKEY28 VARCHAR2(60) NOT NULL
, VKEY29 VARCHAR2(60) NOT NULL
, VKEY30 VARCHAR2(60) NOT NULL
, VKEY31 VARCHAR2(60) NOT NULL
, VKEY32 VARCHAR2(60) NOT NULL
, VKEY33 VARCHAR2(60) NOT NULL
, VKEY34 VARCHAR2(60) NOT NULL
, VKEY35 VARCHAR2(60) NOT NULL
, VKEY36 VARCHAR2(60) NOT NULL
, VKEY37 VARCHAR2(60) NOT NULL
, VKEY38 VARCHAR2(60) NOT NULL
, VKEY39 VARCHAR2(60) NOT NULL
, VKEY40 VARCHAR2(60) NOT NULL
, VKEY41 VARCHAR2(60) NOT NULL
, VKEY42 VARCHAR2(60) NOT NULL
, VKEY43 VARCHAR2(60) NOT NULL
, VKEY44 VARCHAR2(60) NOT NULL
, VKEY45 VARCHAR2(60) NOT NULL
, VKEY46 VARCHAR2(60) NOT NULL
, VKEY47 VARCHAR2(60) NOT NULL
, VKEY48 VARCHAR2(60) NOT NULL
, VKEY49 VARCHAR2(60) NOT NULL
, VKEY50 VARCHAR2(60) NOT NULL
, VKEY51 VARCHAR2(60) NOT NULL
, VKEY52 VARCHAR2(60) NOT NULL
, VKEY53 VARCHAR2(60) NOT NULL
, VKEY54 VARCHAR2(60) NOT NULL
, VKEY55 VARCHAR2(60) NOT NULL
, VKEY56 VARCHAR2(60) NOT NULL
, VKEY57 VARCHAR2(60) NOT NULL
, VKEY58 VARCHAR2(60) NOT NULL
, VKEY59 VARCHAR2(60) NOT NULL
, VKEY60 VARCHAR2(60) NOT NULL
, VD1 NUMBER
, VD2 NUMBER
, VD3 NUMBER
, VD4 NUMBER
, VD5 NUMBER
, VD6 NUMBER
, VD7 NUMBER
, VD8 NUMBER
, VD9 NUMBER
, VD10 NUMBER
, VD11 NUMBER
, VD12 NUMBER
, VD13 NUMBER
, VD14 NUMBER
, VD15 NUMBER
, VD16 NUMBER
, VD17 NUMBER
, VD18 NUMBER
, VD19 NUMBER
, VD20 NUMBER
, VD21 NUMBER
, VD22 NUMBER
, VD23 NUMBER
, VD24 NUMBER
, VD25 NUMBER
, VD26 NUMBER
, VD27 NUMBER
, VD28 NUMBER
, VD29 NUMBER
, VD30 NUMBER
, VD31 NUMBER
, VD32 NUMBER
, VD33 NUMBER
, VD34 NUMBER
, VD35 NUMBER
, VD36 NUMBER
, VD37 NUMBER
, VD38 NUMBER
, VD39 NUMBER
, VD40 NUMBER
, VD41 NUMBER
, VD42 NUMBER
, VD43 NUMBER
, VD44 NUMBER
, VD45 NUMBER
, VD46 NUMBER
, VD47 NUMBER
, VD48 NUMBER
, VD49 NUMBER
, VD50 NUMBER
, VD51 NUMBER
, VD52 NUMBER
, VD53 NUMBER
, VD54 NUMBER
, VD55 NUMBER
, VD56 NUMBER
, VD57 NUMBER
, VD58 NUMBER
, VD59 NUMBER
, VD60 NUMBER
, VKEYP NUMBER
)
NOLOGGING
;
INSERT /*+ APPEND */ INTO WVIEW0031_HALFYEAR
SELECT T0.*, ROWNUM "VKEYP" FROM (SELECT
C.EX_HALFYEAR "VPERIOD"
,A.VKEY1 "VKEY1"
,A.VKEY2 "VKEY2"
,A.VKEY3 "VKEY3"
,A.VKEY4 "VKEY4"
,A.VKEY5 "VKEY5"
,A.VKEY6 "VKEY6"
,A.VKEY7 "VKEY7"
,A.VKEY8 "VKEY8"
,A.VKEY9 "VKEY9"
,A.VKEY10 "VKEY10"
,A.VKEY11 "VKEY11"
,A.VKEY12 "VKEY12"
,A.VKEY13 "VKEY13"
,A.VKEY14 "VKEY14"
,A.VKEY15 "VKEY15"
,A.VKEY16 "VKEY16"
,A.VKEY17 "VKEY17"
,A.VKEY18 "VKEY18"
,A.VKEY19 "VKEY19"
,A.VKEY20 "VKEY20"
,A.VKEY21 "VKEY21"
,A.VKEY22 "VKEY22"
,A.VKEY23 "VKEY23"
,A.VKEY24 "VKEY24"
,A.VKEY25 "VKEY25"
,A.VKEY26 "VKEY26"
,A.VKEY27 "VKEY27"
,A.VKEY28 "VKEY28"
,A.VKEY29 "VKEY29"
,A.VKEY30 "VKEY30"
,A.VKEY31 "VKEY31"
,A.VKEY32 "VKEY32"
,A.VKEY33 "VKEY33"
,A.VKEY34 "VKEY34"
,A.VKEY35 "VKEY35"
,A.VKEY36 "VKEY36"
,A.VKEY37 "VKEY37"
,A.VKEY38 "VKEY38"
,A.VKEY39 "VKEY39"
,A.VKEY40 "VKEY40"
,A.VKEY41 "VKEY41"
,A.VKEY42 "VKEY42"
,A.VKEY43 "VKEY43"
,A.VKEY44 "VKEY44"
,A.VKEY45 "VKEY45"
,A.VKEY46 "VKEY46"
,A.VKEY47 "VKEY47"
,A.VKEY48 "VKEY48"
,A.VKEY49 "VKEY49"
,A.VKEY50 "VKEY50"
,A.VKEY51 "VKEY51"
,A.VKEY52 "VKEY52"
,A.VKEY53 "VKEY53"
,A.VKEY54 "VKEY54"
,A.VKEY55 "VKEY55"
,A.VKEY56 "VKEY56"
,A.VKEY57 "VKEY57"
,A.VKEY58 "VKEY58"
,A.VKEY59 "VKEY59"
,A.VKEY60 "VKEY60"
,SUM(A.VD1) "VD1"
,SUM(A.VD2) "VD2"
,SUM(A.VD3) "VD3"
,SUM(A.VD4) "VD4"
,SUM(A.VD5) "VD5"
,SUM(A.VD6) "VD6"
,SUM(A.VD7) "VD7"
,SUM(A.VD8) "VD8"
,SUM(A.VD9) "VD9"
,SUM(A.VD10) "VD10"
,SUM(A.VD11) "VD11"
,SUM(A.VD12) "VD12"
,SUM(A.VD13) "VD13"
,SUM(A.VD14) "VD14"
,SUM(A.VD15) "VD15"
,SUM(A.VD16) "VD16"
,SUM(A.VD17) "VD17"
,SUM(A.VD18) "VD18"
,SUM(A.VD19) "VD19"
,SUM(A.VD20) "VD20"
,SUM(A.VD21) "VD21"
,SUM(A.VD22) "VD22"
,SUM(A.VD23) "VD23"
,SUM(A.VD24) "VD24"
,SUM(A.VD25) "VD25"
,SUM(A.VD26) "VD26"
,SUM(A.VD27) "VD27"
,SUM(A.VD28) "VD28"
,SUM(A.VD29) "VD29"
,SUM(A.VD30) "VD30"
,SUM(A.VD31) "VD31"
,SUM(A.VD32) "VD32"
,SUM(A.VD33) "VD33"
,SUM(A.VD34) "VD34"
,SUM(A.VD35) "VD35"
,SUM(A.VD36) "VD36"
,SUM(A.VD37) "VD37"
,SUM(A.VD38) "VD38"
,SUM(A.VD39) "VD39"
,SUM(A.VD40) "VD40"
,SUM(A.VD41) "VD41"
,SUM(A.VD42) "VD42"
,SUM(A.VD43) "VD43"
,SUM(A.VD44) "VD44"
,SUM(A.VD45) "VD45"
,SUM(A.VD46) "VD46"
,SUM(A.VD47) "VD47"
,SUM(A.VD48) "VD48"
,SUM(A.VD49) "VD49"
,SUM(A.VD50) "VD50"
,SUM(A.VD51) "VD51"
,SUM(A.VD52) "VD52"
,SUM(A.VD53) "VD53"
,SUM(A.VD54) "VD54"
,SUM(A.VD55) "VD55"
,SUM(A.VD56) "VD56"
,SUM(A.VD57) "VD57"
,SUM(A.VD58) "VD58"
,SUM(A.VD59) "VD59"
,SUM(A.VD60) "VD60"
FROM WVIEW0031_TERM A
INNER JOIN EX_PERIOD B ON B.EX_PERIOD_ID='T' AND B.EX_PERIOD = A.VPERIOD
INNER JOIN EX_DAY C ON B.EX_START = C.EX_DATE
GROUP BY
C.EX_HALFYEAR
,A.VKEY1
,A.VKEY2
,A.VKEY3
,A.VKEY4
,A.VKEY5
,A.VKEY6
,A.VKEY7
,A.VKEY8
,A.VKEY9
,A.VKEY10
,A.VKEY11
,A.VKEY12
,A.VKEY13
,A.VKEY14
,A.VKEY15
,A.VKEY16
,A.VKEY17
,A.VKEY18
,A.VKEY19
,A.VKEY20
,A.VKEY21
,A.VKEY22
,A.VKEY23
,A.VKEY24
,A.VKEY25
,A.VKEY26
,A.VKEY27
,A.VKEY28
,A.VKEY29
,A.VKEY30
,A.VKEY31
,A.VKEY32
,A.VKEY33
,A.VKEY34
,A.VKEY35
,A.VKEY36
,A.VKEY37
,A.VKEY38
,A.VKEY39
,A.VKEY40
,A.VKEY41
,A.VKEY42
,A.VKEY43
,A.VKEY44
,A.VKEY45
,A.VKEY46
,A.VKEY47
,A.VKEY48
,A.VKEY49
,A.VKEY50
,A.VKEY51
,A.VKEY52
,A.VKEY53
,A.VKEY54
,A.VKEY55
,A.VKEY56
,A.VKEY57
,A.VKEY58
,A.VKEY59
,A.VKEY60
) T0;
ALTER TABLE WVIEW0031_HALFYEAR ADD PRIMARY KEY
(
VKEYP
)
NOLOGGING
;



CREATE INDEX IDX_WVIEW0031_HALFYEAR_1
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY1
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_2
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY2
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_3
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY3
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_4
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY4
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_5
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY5
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_6
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY6
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_7
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY7
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_8
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY8
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_9
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY9
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_10
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY10
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_11
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY11
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_12
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY12
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_13
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY13
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_14
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY14
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_15
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY15
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_16
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY16
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_17
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY17
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_18
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY18
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_19
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY19
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_20
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY20
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_21
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY21
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_22
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY22
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_23
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY23
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_24
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY24
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_25
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY25
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_26
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY26
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_27
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY27
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_28
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY28
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_HALFYEAR_29
ON WVIEW0031_HALFYEAR
(
VPERIOD
,VKEY29
)
NOLOGGING
;


COMMIT;


DROP MATERIALIZED VIEW WVIEW0031_YYYY;
DROP TABLE WVIEW0031_YYYY PURGE;

CREATE TABLE WVIEW0031_YYYY
(
VPERIOD VARCHAR2(9) NOT NULL
, VKEY1 VARCHAR2(60) NOT NULL
, VKEY2 VARCHAR2(60) NOT NULL
, VKEY3 VARCHAR2(60) NOT NULL
, VKEY4 VARCHAR2(60) NOT NULL
, VKEY5 VARCHAR2(60) NOT NULL
, VKEY6 VARCHAR2(60) NOT NULL
, VKEY7 VARCHAR2(60) NOT NULL
, VKEY8 VARCHAR2(60) NOT NULL
, VKEY9 VARCHAR2(60) NOT NULL
, VKEY10 VARCHAR2(60) NOT NULL
, VKEY11 VARCHAR2(60) NOT NULL
, VKEY12 VARCHAR2(60) NOT NULL
, VKEY13 VARCHAR2(60) NOT NULL
, VKEY14 VARCHAR2(60) NOT NULL
, VKEY15 VARCHAR2(60) NOT NULL
, VKEY16 VARCHAR2(60) NOT NULL
, VKEY17 VARCHAR2(60) NOT NULL
, VKEY18 VARCHAR2(60) NOT NULL
, VKEY19 VARCHAR2(60) NOT NULL
, VKEY20 VARCHAR2(60) NOT NULL
, VKEY21 VARCHAR2(60) NOT NULL
, VKEY22 VARCHAR2(60) NOT NULL
, VKEY23 VARCHAR2(60) NOT NULL
, VKEY24 VARCHAR2(60) NOT NULL
, VKEY25 VARCHAR2(60) NOT NULL
, VKEY26 VARCHAR2(60) NOT NULL
, VKEY27 VARCHAR2(60) NOT NULL
, VKEY28 VARCHAR2(60) NOT NULL
, VKEY29 VARCHAR2(60) NOT NULL
, VKEY30 VARCHAR2(60) NOT NULL
, VKEY31 VARCHAR2(60) NOT NULL
, VKEY32 VARCHAR2(60) NOT NULL
, VKEY33 VARCHAR2(60) NOT NULL
, VKEY34 VARCHAR2(60) NOT NULL
, VKEY35 VARCHAR2(60) NOT NULL
, VKEY36 VARCHAR2(60) NOT NULL
, VKEY37 VARCHAR2(60) NOT NULL
, VKEY38 VARCHAR2(60) NOT NULL
, VKEY39 VARCHAR2(60) NOT NULL
, VKEY40 VARCHAR2(60) NOT NULL
, VKEY41 VARCHAR2(60) NOT NULL
, VKEY42 VARCHAR2(60) NOT NULL
, VKEY43 VARCHAR2(60) NOT NULL
, VKEY44 VARCHAR2(60) NOT NULL
, VKEY45 VARCHAR2(60) NOT NULL
, VKEY46 VARCHAR2(60) NOT NULL
, VKEY47 VARCHAR2(60) NOT NULL
, VKEY48 VARCHAR2(60) NOT NULL
, VKEY49 VARCHAR2(60) NOT NULL
, VKEY50 VARCHAR2(60) NOT NULL
, VKEY51 VARCHAR2(60) NOT NULL
, VKEY52 VARCHAR2(60) NOT NULL
, VKEY53 VARCHAR2(60) NOT NULL
, VKEY54 VARCHAR2(60) NOT NULL
, VKEY55 VARCHAR2(60) NOT NULL
, VKEY56 VARCHAR2(60) NOT NULL
, VKEY57 VARCHAR2(60) NOT NULL
, VKEY58 VARCHAR2(60) NOT NULL
, VKEY59 VARCHAR2(60) NOT NULL
, VKEY60 VARCHAR2(60) NOT NULL
, VD1 NUMBER
, VD2 NUMBER
, VD3 NUMBER
, VD4 NUMBER
, VD5 NUMBER
, VD6 NUMBER
, VD7 NUMBER
, VD8 NUMBER
, VD9 NUMBER
, VD10 NUMBER
, VD11 NUMBER
, VD12 NUMBER
, VD13 NUMBER
, VD14 NUMBER
, VD15 NUMBER
, VD16 NUMBER
, VD17 NUMBER
, VD18 NUMBER
, VD19 NUMBER
, VD20 NUMBER
, VD21 NUMBER
, VD22 NUMBER
, VD23 NUMBER
, VD24 NUMBER
, VD25 NUMBER
, VD26 NUMBER
, VD27 NUMBER
, VD28 NUMBER
, VD29 NUMBER
, VD30 NUMBER
, VD31 NUMBER
, VD32 NUMBER
, VD33 NUMBER
, VD34 NUMBER
, VD35 NUMBER
, VD36 NUMBER
, VD37 NUMBER
, VD38 NUMBER
, VD39 NUMBER
, VD40 NUMBER
, VD41 NUMBER
, VD42 NUMBER
, VD43 NUMBER
, VD44 NUMBER
, VD45 NUMBER
, VD46 NUMBER
, VD47 NUMBER
, VD48 NUMBER
, VD49 NUMBER
, VD50 NUMBER
, VD51 NUMBER
, VD52 NUMBER
, VD53 NUMBER
, VD54 NUMBER
, VD55 NUMBER
, VD56 NUMBER
, VD57 NUMBER
, VD58 NUMBER
, VD59 NUMBER
, VD60 NUMBER
, VKEYP NUMBER
)
NOLOGGING
;
INSERT /*+ APPEND */ INTO WVIEW0031_YYYY
SELECT T0.*, ROWNUM "VKEYP" FROM (SELECT
C.EX_YYYY "VPERIOD"
,A.VKEY1 "VKEY1"
,A.VKEY2 "VKEY2"
,A.VKEY3 "VKEY3"
,A.VKEY4 "VKEY4"
,A.VKEY5 "VKEY5"
,A.VKEY6 "VKEY6"
,A.VKEY7 "VKEY7"
,A.VKEY8 "VKEY8"
,A.VKEY9 "VKEY9"
,A.VKEY10 "VKEY10"
,A.VKEY11 "VKEY11"
,A.VKEY12 "VKEY12"
,A.VKEY13 "VKEY13"
,A.VKEY14 "VKEY14"
,A.VKEY15 "VKEY15"
,A.VKEY16 "VKEY16"
,A.VKEY17 "VKEY17"
,A.VKEY18 "VKEY18"
,A.VKEY19 "VKEY19"
,A.VKEY20 "VKEY20"
,A.VKEY21 "VKEY21"
,A.VKEY22 "VKEY22"
,A.VKEY23 "VKEY23"
,A.VKEY24 "VKEY24"
,A.VKEY25 "VKEY25"
,A.VKEY26 "VKEY26"
,A.VKEY27 "VKEY27"
,A.VKEY28 "VKEY28"
,A.VKEY29 "VKEY29"
,A.VKEY30 "VKEY30"
,A.VKEY31 "VKEY31"
,A.VKEY32 "VKEY32"
,A.VKEY33 "VKEY33"
,A.VKEY34 "VKEY34"
,A.VKEY35 "VKEY35"
,A.VKEY36 "VKEY36"
,A.VKEY37 "VKEY37"
,A.VKEY38 "VKEY38"
,A.VKEY39 "VKEY39"
,A.VKEY40 "VKEY40"
,A.VKEY41 "VKEY41"
,A.VKEY42 "VKEY42"
,A.VKEY43 "VKEY43"
,A.VKEY44 "VKEY44"
,A.VKEY45 "VKEY45"
,A.VKEY46 "VKEY46"
,A.VKEY47 "VKEY47"
,A.VKEY48 "VKEY48"
,A.VKEY49 "VKEY49"
,A.VKEY50 "VKEY50"
,A.VKEY51 "VKEY51"
,A.VKEY52 "VKEY52"
,A.VKEY53 "VKEY53"
,A.VKEY54 "VKEY54"
,A.VKEY55 "VKEY55"
,A.VKEY56 "VKEY56"
,A.VKEY57 "VKEY57"
,A.VKEY58 "VKEY58"
,A.VKEY59 "VKEY59"
,A.VKEY60 "VKEY60"
,SUM(A.VD1) "VD1"
,SUM(A.VD2) "VD2"
,SUM(A.VD3) "VD3"
,SUM(A.VD4) "VD4"
,SUM(A.VD5) "VD5"
,SUM(A.VD6) "VD6"
,SUM(A.VD7) "VD7"
,SUM(A.VD8) "VD8"
,SUM(A.VD9) "VD9"
,SUM(A.VD10) "VD10"
,SUM(A.VD11) "VD11"
,SUM(A.VD12) "VD12"
,SUM(A.VD13) "VD13"
,SUM(A.VD14) "VD14"
,SUM(A.VD15) "VD15"
,SUM(A.VD16) "VD16"
,SUM(A.VD17) "VD17"
,SUM(A.VD18) "VD18"
,SUM(A.VD19) "VD19"
,SUM(A.VD20) "VD20"
,SUM(A.VD21) "VD21"
,SUM(A.VD22) "VD22"
,SUM(A.VD23) "VD23"
,SUM(A.VD24) "VD24"
,SUM(A.VD25) "VD25"
,SUM(A.VD26) "VD26"
,SUM(A.VD27) "VD27"
,SUM(A.VD28) "VD28"
,SUM(A.VD29) "VD29"
,SUM(A.VD30) "VD30"
,SUM(A.VD31) "VD31"
,SUM(A.VD32) "VD32"
,SUM(A.VD33) "VD33"
,SUM(A.VD34) "VD34"
,SUM(A.VD35) "VD35"
,SUM(A.VD36) "VD36"
,SUM(A.VD37) "VD37"
,SUM(A.VD38) "VD38"
,SUM(A.VD39) "VD39"
,SUM(A.VD40) "VD40"
,SUM(A.VD41) "VD41"
,SUM(A.VD42) "VD42"
,SUM(A.VD43) "VD43"
,SUM(A.VD44) "VD44"
,SUM(A.VD45) "VD45"
,SUM(A.VD46) "VD46"
,SUM(A.VD47) "VD47"
,SUM(A.VD48) "VD48"
,SUM(A.VD49) "VD49"
,SUM(A.VD50) "VD50"
,SUM(A.VD51) "VD51"
,SUM(A.VD52) "VD52"
,SUM(A.VD53) "VD53"
,SUM(A.VD54) "VD54"
,SUM(A.VD55) "VD55"
,SUM(A.VD56) "VD56"
,SUM(A.VD57) "VD57"
,SUM(A.VD58) "VD58"
,SUM(A.VD59) "VD59"
,SUM(A.VD60) "VD60"
FROM WVIEW0031_HALFYEAR A
INNER JOIN EX_PERIOD B ON B.EX_PERIOD_ID='H' AND B.EX_PERIOD = A.VPERIOD
INNER JOIN EX_DAY C ON B.EX_START = C.EX_DATE
GROUP BY
C.EX_YYYY
,A.VKEY1
,A.VKEY2
,A.VKEY3
,A.VKEY4
,A.VKEY5
,A.VKEY6
,A.VKEY7
,A.VKEY8
,A.VKEY9
,A.VKEY10
,A.VKEY11
,A.VKEY12
,A.VKEY13
,A.VKEY14
,A.VKEY15
,A.VKEY16
,A.VKEY17
,A.VKEY18
,A.VKEY19
,A.VKEY20
,A.VKEY21
,A.VKEY22
,A.VKEY23
,A.VKEY24
,A.VKEY25
,A.VKEY26
,A.VKEY27
,A.VKEY28
,A.VKEY29
,A.VKEY30
,A.VKEY31
,A.VKEY32
,A.VKEY33
,A.VKEY34
,A.VKEY35
,A.VKEY36
,A.VKEY37
,A.VKEY38
,A.VKEY39
,A.VKEY40
,A.VKEY41
,A.VKEY42
,A.VKEY43
,A.VKEY44
,A.VKEY45
,A.VKEY46
,A.VKEY47
,A.VKEY48
,A.VKEY49
,A.VKEY50
,A.VKEY51
,A.VKEY52
,A.VKEY53
,A.VKEY54
,A.VKEY55
,A.VKEY56
,A.VKEY57
,A.VKEY58
,A.VKEY59
,A.VKEY60
) T0;
ALTER TABLE WVIEW0031_YYYY ADD PRIMARY KEY
(
VKEYP
)
NOLOGGING
;



CREATE INDEX IDX_WVIEW0031_YYYY_1
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY1
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_2
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY2
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_3
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY3
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_4
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY4
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_5
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY5
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_6
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY6
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_7
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY7
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_8
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY8
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_9
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY9
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_10
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY10
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_11
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY11
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_12
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY12
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_13
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY13
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_14
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY14
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_15
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY15
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_16
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY16
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_17
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY17
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_18
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY18
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_19
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY19
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_20
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY20
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_21
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY21
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_22
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY22
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_23
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY23
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_24
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY24
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_25
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY25
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_26
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY26
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_27
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY27
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_28
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY28
)
NOLOGGING
;

CREATE INDEX IDX_WVIEW0031_YYYY_29
ON WVIEW0031_YYYY
(
VPERIOD
,VKEY29
)
NOLOGGING
;

COMMIT;


EXIT
