zOs/SQL/SV31REST
set current sqlid = 'S100447';
select count (*) from OA1A.TSV310A1;
select count (*) from OA1A.TSV311A1;
select count (*) from OA1A.TSV312A1;
select count (*) from OA1A.TSV313A1;
select count (*) from OA1A.TSV314A1;
select count (*) from OA1A.TSV315A1;
select count (*) from OA1A.TSV316A1;
select count (*) from OA1A.TSV317A1;
select count (*) from OA1A.TSV318A1;
select count (*) from OA1A.TSV319A1;
alter table OA1A.TSV310A1 alter BUSINESSUNITID restart with 1;
alter table OA1A.TSV311A1 alter TAXCLIENTID restart with 1;
alter table OA1A.TSV312A1 alter SECURITYID restart with 1;
alter table OA1A.TSV313A1 alter SECPOSID restart with 1;
alter table OA1A.TSV314A1 alter SECTXID restart with 1;
alter table OA1A.TSV315A1 alter MMPOSID restart with 1;
alter table OA1A.TSV316A1 alter MMINCOMEID restart with 1;
alter table OA1A.TSV317A1 alter SACID restart with 1;
alter table OA1A.TSV318A1 alter SACINCOMEID restart with 1;
alter table OA1A.TSV319A1 alter FEEID restart with 1;
commit;
;;;
with c as
( select *
from sysibm.sysColumns c
where tbName like 'TSV31%' and tbCreator = 'OA1A'
and default between 'D' and 'J'
)
select 'select count (*) from '
|| strip(tbCreator) || '.' || strip(tbName) || ';' , c.*
from c
union all
select 'alter table ' || strip(tbCreator) || '.' || strip(tbName)
|| ' alter ' || strip(name) || ' restart with 1;', c.*
from c
order by 1
;;;
select count(*) FROM OA1A.TSV310A1;
ALTER TABLE OA1A.TSV310A1
alter BUSINESSUNITID restart with 1;
rollback;