--
-- $Id$
--
-- Customer specific once-script BLCC#55806.SQL.

DEFINE thisfile = 'BLCC#55806.SQL'
DEFINE dbuser   = '^BLCC'

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

UPDATE mld_stdmelding sm
   SET sm.mld_stdmelding_vervaldatum = TO_DATE ('01-01-2019', 'dd-mm-yyyy')
 WHERE sm.mld_stdmelding_vervaldatum IS NULL
       AND EXISTS
          (SELECT 1
             FROM mld_discipline
            WHERE ins_discipline_key = sm.mld_ins_discipline_key
                  AND ins_srtdiscipline_key IN (1, 42, 43))
       AND sm.mld_stdmelding_key NOT IN (14, 915);

COMMIT;

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

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

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