-- Customer specific once-script PRIS4.
--
-- (c) 2012 SG|facilitor bv
-- $Revision$
-- $Id$
--
-- Support: +31 53 4800700
SET ECHO ON
SPOOL xpris4.lst
SET DEFINE OFF

/* Formatted on 15-11-2012 11:54:32 (QP5 v5.115.810.9015) */
BEGIN
   -- Op KV zetten alle afgemelde/TV opdrachten van type 'Yask-opdracht' (261)
   -- en -voor de zekerheid- onder 'Yask-melding' (21)!
   FOR rc
   IN (  SELECT   o.mld_opdr_key
           FROM   mld_opdr o,
                  mld_melding m,
                  mld_stdmelding sm,
                  mld_discipline md
          WHERE       o.mld_statusopdr_key = 6
                  AND o.mld_typeopdr_key = 261
                  AND o.mld_melding_key = m.mld_melding_key
                  AND m.mld_stdmelding_key = sm.mld_stdmelding_key
                  AND md.ins_srtdiscipline_key = 21
                  AND sm.mld_ins_discipline_key = md.ins_discipline_key
                  AND fac.gettrackingdate ('ORDNEW', o.mld_opdr_key) <
                        TO_DATE ('01-11-2012', 'dd-mm-yyyy')
       ORDER BY   o.mld_opdr_key)
   LOOP
      MLD.setopdrachtstatus (rc.mld_opdr_key, 9, 4);   -- Op KV door FACILITOR
      COMMIT;
   END LOOP;
END;
/

BEGIN adm.systrackscript('$Workfile: pris4.sql $', '$Revision$', 1); END;
/
SPOOL OFF
@pris.sql
