-- ABS-34733
-------------   DBCONSISTENCYCHECK   ---------------------
update dbconsistencycheck db
set db.sqlstatement = 'select a.productlistpercustomer_id, a.product_id, b.code, b.productgroup_id
                        from productlistpercustomer a, product b
                        where a.product_id = b.product_id 
                        and a.dateinactive = to_date(''31.12.2099 '','' dd.mm.yyyy '')
                        and not exists (select pgpc.productgroup_id 
                        from productgrouppercustomer pgpc 
                        where pgpc.customer_id = a.customer_id and 
                        pgpc.productgroup_id = b.productgroup_id)'
 where db.dbconsistencycheck_id = 4;

commit;