--
-- $Id$
--

DEFINE thisfile = 'NYBU#54340.SQL'
DEFINE dbuser   = '^NYBU'

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

-- alle studenten moeten uit de _Default groep
-- de studenten import zal ze autoamtisch rechten geven voor  _Students
DELETE fac_gebruikersgroep gg
 WHERE gg.fac_groep_key = 1
       AND prs_perslid_key IN
                (SELECT p.prs_perslid_key
                   FROM prs_v_afdeling_perslid p, prs_v_afdeling a
                  WHERE p.prs_afdeling_key = a.prs_afdeling_key
                        AND prs_bedrijf_key = 1643);           
                        

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