--
-- $Id$
--
-- Verwijder ins_deelsrtcontrole van onterecht geacoordeerde (gestarte) mjob controle
-- 30081 hoort bij object 8073100000044 en 30082 hoort bij object 8073100000045
-- 115 = INSCBE

DEFINE thisfile = 'WOWW#55721.SQL'
DEFINE dbuser   = '*'

SET ECHO ON
SET DEFINE ON
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
WHENEVER SQLERROR EXIT;
SELECT adm.scriptspoolfile('&dbuser', '&thisfile') AS fcltlogfile FROM DUAL;
WHENEVER SQLERROR CONTINUE;
SPOOL &fcltlogfile
SET DEFINE OFF

------ payload begin ------

DELETE FROM ins_deelsrtcontrole
      WHERE ins_deelsrtcontrole_key IN (30081, 30082);

DELETE FROM fac_tracking
      WHERE     fac_tracking_refkey IN (30081, 30082)
            AND fac_tracking_datum > SYSDATE - 3
            AND fac_srtnotificatie_key = 115;

------ payload end   ------

SET DEFINE OFF
BEGIN adm.systrackscriptId ('$Id$', 1); END;
/

COMMIT;
SET ECHO OFF
SPOOL OFF
SET DEFINE ON
PROMPT Logfile of this upgrade is: &fcltlogfile