--
-- $Id$
--
-- Customer specific once-script UWVA118.

DEFINE thisfile = 'UWVA118.SQL'
DEFINE dbuser   = '^UWVA'

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

--UWVA#56130: Alle BSN gegevens verwijderen bij bezoekers en reserveringen.
DELETE bez_kenmerkwaarde
 WHERE bez_kenmerk_key = 1;

DELETE FROM res_kenmerkwaarde rkw
      WHERE rkw.res_kenmerk_key =
               (SELECT rk.res_kenmerk_key
                  FROM res_kenmerk rk
                 WHERE rk.res_srtkenmerk_key = 3           -- Kenmerksoort BSN
                                                AND rkw.res_kenmerk_key = rk.res_kenmerk_key);

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

--@@uwva_prs.sql
--@@uwva_fin.sql
--@@uwva_hv.sql
--@@uwva_misc.sql
