-- Customer specific once-script
--
-- Support: +31 53 4800700
--


SET ECHO ON
SET DEFINE ON
column fcltlogfile new_value fcltlogfile NOPRINT;
select UPPER(USER) || '_ASDL#33376.lst' as fcltlogfile from dual;
spool &fcltlogfile
SET DEFINE OFF

DELETE fac_tracking
 WHERE fac_tracking_key IN
             (SELECT fac_tracking_key
                FROM fac_tracking ft, fac_srtnotificatie fs
               WHERE ft.fac_srtnotificatie_key = fs.fac_srtnotificatie_key
                 AND fac_srtnotificatie_xmlnode = 'melding'
                 AND NOT EXISTS
                        (SELECT 1
                           FROM mld_melding
                          WHERE mld_melding_key = fac_tracking_refkey));

COMMIT;

BEGIN adm.systrackscriptid('$Id$'); END;
/

COMMIT;
SPOOL OFF
