CREATE OR REPLACE PROCEDURE prc_data_chk03_tmp AS
BEGIN
execute immediate 'truncate table polreg.rev_data_chk03';
insert into polreg.rev_data_chk03 (transactionno, tab_name, busstype, comet)
select transactionno, 'POL_REG_LCPRODUCT', '03', '' from POL_REG_LCPOLTRANSACTION a where a.busstype = 03
and not exists
(select 1 from POL_REG_LCPRODUCT b where a.transactionno = b.transactionno);
insert into polreg.rev_data_chk03 (transactionno, tab_name, busstype, comet)
select transactionno, 'POL_REG_LJTEMPFEE', '03', '' from POL_REG_LCPOLTRANSACTION a where a.busstype = 03
and not exists
(select 1 from POL_REG_LJTEMPFEE b where a.transactionno = b.transactionno);
insert into polreg.rev_data_chk03 (transactionno, tab_name, busstype, comet)
select transactionno, 'POL_REG_LJAPAY', '03', '' from POL_REG_LCPOLTRANSACTION a where a.busstype = 03
and not exists
(select 1 from POL_REG_LJAPAY b where a.transactionno = b.transactionno);
insert into polreg.rev_data_chk03 (transactionno, tab_name, busstype, comet)
select transactionno, 'POL_REG_LCINSUREACC', '03', '' from POL_REG_LCPOLTRANSACTION a where a.busstype = 03
and not exists
(select 1 from POL_REG_LCINSUREACC b where a.transactionno = b.transactionno);
commit;
END;
BEGIN
execute immediate 'truncate table polreg.rev_data_chk03';
insert into polreg.rev_data_chk03 (transactionno, tab_name, busstype, comet)
select transactionno, 'POL_REG_LCPRODUCT', '03', '' from POL_REG_LCPOLTRANSACTION a where a.busstype = 03
and not exists
(select 1 from POL_REG_LCPRODUCT b where a.transactionno = b.transactionno);
insert into polreg.rev_data_chk03 (transactionno, tab_name, busstype, comet)
select transactionno, 'POL_REG_LJTEMPFEE', '03', '' from POL_REG_LCPOLTRANSACTION a where a.busstype = 03
and not exists
(select 1 from POL_REG_LJTEMPFEE b where a.transactionno = b.transactionno);
insert into polreg.rev_data_chk03 (transactionno, tab_name, busstype, comet)
select transactionno, 'POL_REG_LJAPAY', '03', '' from POL_REG_LCPOLTRANSACTION a where a.busstype = 03
and not exists
(select 1 from POL_REG_LJAPAY b where a.transactionno = b.transactionno);
insert into polreg.rev_data_chk03 (transactionno, tab_name, busstype, comet)
select transactionno, 'POL_REG_LCINSUREACC', '03', '' from POL_REG_LCPOLTRANSACTION a where a.busstype = 03
and not exists
(select 1 from POL_REG_LCINSUREACC b where a.transactionno = b.transactionno);
commit;
END;