--
-- $Id$
--
-- Opruimen ongeldige view

DEFINE thisfile = 'FSN#38666.SQL'
DEFINE dbuser   = '^AA|^ASMS|^GULU|^NMMS|^RABO|^ZKHM'
DEFINE custid   = '^AA|ASMS|GULU|NMMS|RABO|ZKHM'


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

DELETE fac_gebruikersgroep gg
 WHERE EXISTS
          (SELECT p.prs_perslid_key
             FROM prs_perslid p
            WHERE prs_perslid_oslogin IS NULL
              AND prs_perslid_oslogin2 IS NULL
              AND p.prs_perslid_key = gg.prs_perslid_key);

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

@@ &custid