--
-- $Id$
--
-- Customer specific once-script GRKL6.
DEFINE thisfile = 'GRKL6.SQL'
DEFINE dbuser   = '^GRKL'
DEFINE custid   = 'GRKL'

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

-- CUST02-notificatie naar hard e-mail adres van Inkoop (via job naar melder=leidingevende van 'Afmelden ICT & Fac.'-melding).
INSERT INTO fac_srtnotificatie (fac_srtnotificatie_code,
                                fac_srtnotificatie_mode,
                                fac_srtnotificatie_oms,
                                fac_srtnotificatie_xmlnode,
                                fac_srtnotificatie_url,
                                fac_srtnotificatie_groep)
   SELECT 'CUST02',
          0,
          'Reminder: Unlisten ProActive afgemelde medewerker',
          'melding',
          NULL,
          0
     FROM DUAL
    WHERE NOT EXISTS (SELECT 1
                        FROM fac_srtnotificatie
                       WHERE fac_srtnotificatie_code = 'CUST02');

-- CUST01/CUST02-notificatiejob (key=21) notificeert vanaf nu (per GRKL6) via harde e-mail adressen (flags=1).
UPDATE fac_notificatie_job
   SET fac_notificatie_job_flags = 1
 WHERE fac_notificatie_job_key = 21;

COMMIT;

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

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

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

@@&custid
