--
-- $Id$
--
-- Customer specific once-script VLKC#65233.SQL.
DEFINE thisfile = 'VLKC#65233.SQL'
DEFINE dbuser   = '^VLKC'

SET ECHO ON
SET DEFINE ON
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
COLUMN fcltcusterr NEW_VALUE fcltcusterr NOPRINT;
WHENEVER SQLERROR CONTINUE;
SELECT adm.getscriptspoolfile('&thisfile') AS fcltlogfile FROM DUAL;
SPOOL &fcltlogfile
WHENEVER SQLERROR EXIT;
SELECT adm.checkscriptcust('&dbuser') AS fcltcusterr FROM DUAL;
WHENEVER SQLERROR CONTINUE;
PROMPT &fcltcusterr
SET DEFINE OFF

------ payload begin ------

-- Schonen eigen tabel VasteKostenMnd (2017, 2018 en 2019).
UPDATE fac_usrdata
   SET fac_usrdata_verwijder = SYSDATE
 WHERE fac_usrdata_verwijder IS NULL
       AND fac_usrtab_key = 81                               -- VasteKostenMnd
       AND SUBSTR (fac_usrdata_code, 1, 4) IN ('2017', '2018', '2019');
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
