/* Formatted on 15-5-2019 11:14:53 (QP5 v5.336) */
--
-- $Id$
--
-- Door foutieve import zijn dubbele medewerkers, zonder login, aangemaakt. Deze moeten verwijderd worden

DEFINE thisfile = 'WZUV#57078.SQL'
DEFINE dbuser   = '^WZUV'

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;
SET DEFINE OFF

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


UPDATE prs_perslid p
   SET p.PRS_PERSLID_NR = '',
       p.PRS_PERSLID_VERWIJDER = TO_DATE ('1-1-1900', 'dd-mm-yyyy')
 WHERE     prs_srtperslid_key <> 8561                         -- geen clienten
       AND prs_perslid_oslogin IS NULL
     -- AND UPPER (prs_perslid_email) LIKE '%WZUVELUWE.NL%'
       AND prs_perslid_upper NOT LIKE '%INACTIEF%'
       AND prs_perslid_verwijder IS 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