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

DEFINE thisfile = 'UWVA108.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#41572: Eenmalig anonimiseren Notitie-veld voor alle meldingen onder de
-- volgende 2 vakgroepen:
-- 245=Aanvragen/Tolkdiensten
-- 264=Vertaaldienst/Vertalingen
UPDATE mld_melding_note mn
   SET mld_melding_note_omschrijving = '[Geanonimiseerd.]'
 WHERE EXISTS
          (SELECT 1
             FROM mld_melding m, mld_stdmelding sm
            WHERE m.mld_melding_key = mn.mld_melding_key
                  AND m.mld_stdmelding_key = sm.mld_stdmelding_key
                  AND sm.mld_ins_discipline_key IN (245, 264));

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