-- Customer specific once-script KING#26536.sql
--
-- (c) 2013 SG|facilitor bv
-- $Revision$
-- $Id$
--
-- Support: +31 53 4800700

SET ECHO ON
SPOOL xKING#26536.lst
SET DEFINE OFF

PROMPT Opnieuw versturen:
SELECT fac_tracking_refkey
  FROM fac_tracking ft, fac_srtnotificatie fsn
 WHERE fac_srtnotificatie_code = 'BES2SN'
       AND ft.fac_srtnotificatie_key = fsn.fac_srtnotificatie_key
       AND fac_tracking_datum >
             TO_DATE ('02/05/2013 19:00:00', 'DD/MM/YYYY HH24:MI:SS');
              -- Release 5.3.1 was 2 mei

-- Alle bes_bestelopdr_status opdrachten die sinds de release van 5.3.1 de deur
-- uit zijn gegaan opnieuw versturen door de status terug te zetten op 3
-- (de XSL was niet lekker)
UPDATE bes_bestelopdr
   SET bes_bestelopdr_status = 3
 WHERE bes_bestelopdr_key IN
       (SELECT fac_tracking_refkey
          FROM fac_tracking ft, fac_srtnotificatie fsn
         WHERE fac_srtnotificatie_code = 'BES2SN'
               AND ft.fac_srtnotificatie_key = fsn.fac_srtnotificatie_key
               AND fac_tracking_datum >
                     TO_DATE ('02/05/2013 19:00:00', 'DD/MM/YYYY HH24:MI:SS'));

BEGIN adm.systrackscript('$Workfile: KING#26536.sql $', '$Revision$', 1); END;
/
COMMIT;
SPOOL OFF;
