--
-- $Id$
--
-- In bulk contracten een nieuwe beheerder geven

DEFINE thisfile = 'BLCC#54154.sql'
DEFINE dbuser   = '^BLCC'

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

-- 2401 = Anieke Thomassen
-- 621 = BCC Huurcontracten
-- 725 = BCC Shared facilities
-- 741 = BCC IT diensten
-- 731 = BCC Utilities
-- 722 = BCC Utility infra/voorz.
-- 724 = BCC General infra/voorz.

UPDATE cnt_contract
   SET prs_perslid_key_beh = 2401
 WHERE     cnt_contract_looptijd_tot >= TRUNC (SYSDATE)
       AND cnt_contract_verwijder IS NULL
       AND ins_discipline_key IN (621, 725, 741, 731, 722, 724)
       AND prs_perslid_key_beh != 2401;

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