--
-- $Id$
--
-- Script containing customer specific sql statements for the DVON database
-- Voor livegang van DVON, dit script verwijderd alle testdata uit de (test)omgeving.

DEFINE thisfile = 'DVON#52588.SQL'
DEFINE dbuser   = '^DVON'

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 ------

BEGIN
FAC.INITSESSION('NL');
END;
/
-- DELETE ALLES IN DEZE TABELLEN

DELETE FROM bes_bestelling_item;
DELETE FROM bes_bestelling;
DELETE FROM bes_bestelopdr_item;
DELETE FROM mld_melding_object;
DELETE FROM ins_deel;
DELETE FROM bes_bestelopdr;
DELETE FROM mld_opdr;
DELETE FROM mld_melding;
DELETE
  FROM fac_tracking
 WHERE fac_srtnotificatie_key IN
             (SELECT fac_srtnotificatie_key
                FROM fac_srtnotificatie
               WHERE    fac_srtnotificatie_code LIKE '%MLD%'
                     OR fac_srtnotificatie_code LIKE '%BES%'
                     OR fac_srtnotificatie_code LIKE '%INS%'
                     OR fac_srtnotificatie_code LIKE '%RES%');

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

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

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