--
-- $Id$
--
-- Heropenen van diverse meldingen die waren gesloten agv slechte workflow

DEFINE thisfile = 'KIBE#40368_2.SQL'
DEFINE dbuser   = '^KIBE'
DEFINE custid   = 'KIBE'

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

-- Zet de status naar 2 (Nieuw)
UPDATE mld_melding
   SET mld_melding_status = 2
 WHERE mld_melding_key IN
             (5460,
              5448,
              5416,
              5377,
              5356,
              5351,
              5317,
              5295,
              5280,
              5262,
              5224,
              5166,
              5106,
              5102,
              5075,
              5072,
              5037,
              5020,
              5017,
              5016,
              5015,
              5013,
              4994,
              4989,
              4970,
              4961,
              4959,
              4958,
              4798,
              4779);
 
-- Voeg ook tracking toe. Key 45 = MLDUPD 
INSERT INTO fac_tracking (fac_tracking_datum,
                          fac_srtnotificatie_key,
                          fac_tracking_refKey,
                          fac_tracking_oms)
   SELECT SYSDATE,
          45,
          mld_melding_key,
          'Melding op verzoek van Kibeo naart status Nieuw gezet'
     FROM mld_melding
    WHERE mld_melding_key IN
                (5460,
                 5448,
                 5416,
                 5377,
                 5356,
                 5351,
                 5317,
                 5295,
                 5280,
                 5262,
                 5224,
                 5166,
                 5106,
                 5102,
                 5075,
                 5072,
                 5037,
                 5020,
                 5017,
                 5016,
                 5015,
                 5013,
                 4994,
                 4989,
                 4970,
                 4961,
                 4959,
                 4958,
                 4798,
                 4779);

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