--
-- $Id$
--
-- Script om foute controles te corigeren. Controles hebben onterecht een uitvoerdatum (ins_deelsrtcontrole_datum) gekregen.

DEFINE thisfile = 'HCAS#51550.SQL'
DEFINE dbuser   = '^HCAS'
DEFINE custid   = 'HCAS'

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

-- 5 en 6 zijn afgemeld en voltooid

UPDATE ins_deelsrtcontrole
   SET ins_deelsrtcontrole_datum = NULL
 WHERE ins_deelsrtcontrole_status NOT IN (5, 6)
       AND ins_deelsrtcontrole_datum IS NOT NULL;

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