zOs/TX/PA2DIINS
delete from qz92crT.tqz91pa2diPart;
delete from qz92crT.tqz91pa2diData;
insert into qz92crT.tqz91pa2diPart
with c (c, b, i) as
( select 'A', 'B', 1 from sysibm.sysDummy1
union all select 'B', 'C', 2 from sysibm.sysDummy1
union all select 'C', 'D', 3 from sysibm.sysDummy1
union all select 'D', 'E', 4 from sysibm.sysDummy1
union all select 'E', 'F', 5 from sysibm.sysDummy1
)
, d (d, j) as
( select date('01.01.2016'), 0 from sysibm.sysDummy1
union all select d + 1 month, j+1
from d where j < 11
)
select i + 5 * j, c, b, d, d + 1 month from c, d
;
insert into qz92crT.tqz91pa2diData
with c (c, i) as
( select 'A', 1 from sysibm.sysDummy1
union all select 'B', 2 from sysibm.sysDummy1
union all select 'C', 3 from sysibm.sysDummy1
union all select 'D', 4 from sysibm.sysDummy1
union all select 'E', 5 from sysibm.sysDummy1
)
, d (d, j) as
( select date('01.01.2016'), 0 from sysibm.sysDummy1
union all select d + 1 day, j+1
from d where j < 365
)
, e (c ,e) as
(
select '', 'empty key append' from sysibm.sysDummy1
union all select substr(name, 4, 3)
, strip( left(strip(creator) || '.' || strip(name)
|| ' in ' || strip(dbName) || '.' || strip(tsname)
, 100))
from sysibm.sysTables
where creator = 'SYSIBM'
)
, j as
(
select c.c || e.c c, d.d, e.e e
from c, d, e
)
, p as
(
select
( select p from qz92crT.tqz91pa2diPart
where c >= cifBeg and c < cifEnd
and d >= aDtBeg and d < aDtEnd
) p
, c, d, e
from j
)
select * from p
;