--
-- $Id$
--
-- Script containing customer specific sql statements for the STCH database

DEFINE thisfile = 'STCH#51457_3.SQL'
DEFINE dbuser   = 'STCH'

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


BEGIN
   FOR rec
      IN (  SELECT prs_perslid_key
              FROM prs_perslid
             WHERE prs_perslid_verwijder IS NULL
                   AND prs_afdeling_key = 449
                   AND prs_perslid_key NOT IN (57489, 99925, 125, 57475, 70523, 57559, 40603, 59447, 102746, 9841, 9061)
          ORDER BY 1)
   LOOP
      BEGIN
         prs.delete_perslid (1, rec.prs_perslid_key);
      END;
   END LOOP;
END;
/

------ payload end   ------

SET DEFINE OFF
BEGIN adm.systrackscriptId ('$Id$', 0); END;
/

COMMIT;
SET ECHO OFF
SPOOL OFF
SET DEFINE ON
PROMPT Logfile of this upgrade is: &fcltlogfile