--
-- $Id: RABO#56275 Daan Brandt
--  Aanpassen emailadressen gebouwen met Regio keys 26,21,27

DEFINE thisfile = 'RABO#56320.SQL'
DEFINE dbuser   = '^RABO'

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



UPDATE alg_gebouw set alg_gebouw_email = 'facilitaire.services.kring.OBR@rabobank.nl' where alg_locatie_key IN (SELECT alg_locatie_key from alg_v_locatie_gegevens WHERE alg_regio_key = 26);

UPDATE alg_gebouw set alg_gebouw_email = 'Facilitaire.Services.Kring.GEZ@rabobank.nl' where alg_locatie_key IN (SELECT alg_locatie_key from alg_v_locatie_gegevens WHERE alg_regio_key = 21 );

UPDATE alg_gebouw set alg_gebouw_email = 'facilitaire.Services.Kring.OGN@rabobank.nl' where alg_locatie_key IN (SELECT alg_locatie_key from alg_v_locatie_gegevens WHERE alg_regio_key = 27);



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