-- Customer specific once-script voor HMOD

-- $Id$
--
-- PRS-update ivm vinkboxjes met waarde 0 waardoor de workflow HR niet goed werkt. 

DEFINE thisfile = 'HMOD#58494.SQL'
DEFINE dbuser   = '^HMOD'

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

/* Formatted on 3-12-2019 12:26:47 (QP5 v5.318) */
DELETE FROM prs_kenmerklink kl
      WHERE kl.prs_kenmerklink_key IN
                (SELECT k.prs_kenmerklink_key
                   FROM prs_kenmerklink k, prs_kenmerk key
                  WHERE     k.prs_kenmerk_key = key.prs_kenmerk_key
                        AND k.prs_kenmerklink_waarde = '0' -- 0-waarde vanuit import is niet ok
                        AND key.prs_kenmerk_niveau = 'P'
                        AND key.prs_kenmerk_kenmerktype = 'V' -- persoonskenmerken + type vinkbox
                                                             );

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