--
-- $Id$
--
-- Stel puo_bcc instelling in op archief@aa-fm.com 
-- Verwijder tevens alle extra archief@aa-fm.com adressen bij de technische adressen

DEFINE thisfile = 'AAFM#41560.SQL'
DEFINE dbuser   = '^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 -----

UPDATE fac_setting
   SET fac_setting_pvalue = 'archief@aa-fm.com'
 WHERE UPPER (fac_setting_name) = 'PUO_BCC';
 
UPDATE prs_bedrijfadres
   SET prs_bedrijfadres_url =
          REPLACE (prs_bedrijfadres_url, ';archief@aa-fm.com', '')
 WHERE LOWER (prs_bedrijfadres_url) LIKE 'mailto:%;archief@aa-fm.com%';

UPDATE prs_bedrijfadres
   SET prs_bedrijfadres_url =
          REPLACE (prs_bedrijfadres_url, '; archief@aa-fm.com', '')
 WHERE LOWER (prs_bedrijfadres_url) LIKE 'mailto:%; archief@aa-fm.com%';

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

