
-- general
delete fac_notificatie;
delete web_user_messages;
delete fac_tracking t
 where exists
           (select fac_srtnotificatie_key
              from fac_srtnotificatie sn
             where     sn.fac_srtnotificatie_key = t.fac_srtnotificatie_key
                   and sn.fac_srtnotificatie_xmlnode in ('bestelopdr',
                                                         'bezoeker',
                                                         'opdracht',
                                                         'reservering',
                                                         'xreservering',
                                                         'melding',
                                                         'factuur',
                                                         'bestelling',
                                                         'afspraak'));




-- fin
delete fin_kenmerkfactuur;
delete fin_factuurregel;
delete fin_factuur;

DROP SEQUENCE fin_s_fin_factuur_key;
CREATE SEQUENCE fin_s_fin_factuur_key MINVALUE 0 NOCACHE;

-- bes
delete bes_kenmerkbestell;
delete bes_kenmerkbesteli;
delete bes_bestelling_item;
delete bes_bestelopdr_item;
delete bes_bestelopdr;
delete bes_bestelling;
DROP SEQUENCE BES_S_BES_BESTELLING_KEY;
CREATE SEQUENCE bes_s_bes_bestelling_key  MINVALUE 0 NOCACHE;

-- mld 
delete mld_kenmerkopdr;
delete mld_kenmerkmelding;
delete mld_opdr;
delete mld_melding_note;
delete mld_melding_object;
delete mld_melding;
DROP SEQUENCE MLD_S_MLD_MELDING_KEY;
CREATE SEQUENCE mld_s_mld_melding_key MINVALUE 0 NOCACHE;

-- bez/res
delete res_rsv_deel;
delete res_rsv_artikel;
delete bez_kenmerkwaarde;
delete bez_bezoekers;
delete bez_afspraak;
delete res_kenmerkwaarde;
delete res_rsv_ruimte;
delete res_reservering;
DROP SEQUENCE bez_s_bez_afspraak_key;
CREATE SEQUENCE bez_s_bez_afspraak_key MINVALUE 0 NOCACHE;
DROP SEQUENCE res_s_res_reservering_key;
CREATE SEQUENCE res_s_res_reservering_key MINVALUE 0 NOCACHE;

update prs_perslid set prs_perslid_verwijder = SYSDATE where prs_perslid_key NOT IN (3,4,5,6,41);