SURF#88345 -- Reserveringen omhangen naar nieuwe ruimten
svn path=/Customer/; revision=69838
This commit is contained in:
91
onces/SURF/SURF#88345.sql
Normal file
91
onces/SURF/SURF#88345.sql
Normal file
@@ -0,0 +1,91 @@
|
||||
--
|
||||
-- $Id$
|
||||
--
|
||||
-- Reserveringen omhangen naar nieuwe ruimten + opnieuw synchen naar Exchange
|
||||
--
|
||||
|
||||
DEFINE thisfile = 'SURF#88345.SQL'
|
||||
DEFINE dbuser = 'SURF'
|
||||
|
||||
SET ECHO ON
|
||||
SET DEFINE ON
|
||||
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
|
||||
COLUMN fcltcusterr NEW_VALUE fcltcusterr NOPRINT;
|
||||
WHENEVER SQLERROR CONTINUE;
|
||||
SELECT adm.getscriptspoolfile('&thisfile') AS fcltlogfile FROM DUAL;
|
||||
SPOOL &fcltlogfile
|
||||
WHENEVER SQLERROR EXIT;
|
||||
SELECT adm.checkscriptcust('&dbuser') AS fcltcusterr FROM DUAL;
|
||||
WHENEVER SQLERROR CONTINUE;
|
||||
PROMPT &fcltcusterr
|
||||
SET DEFINE OFF
|
||||
|
||||
------ payload begin ------
|
||||
|
||||
DECLARE CURSOR c1
|
||||
IS
|
||||
SELECT
|
||||
x.rsv_key,
|
||||
x.opstel_oud,
|
||||
x.ruimte_oud,
|
||||
x.opstel_nieuw,
|
||||
rr.res_ruimte_nr ruimte_nieuw
|
||||
FROM
|
||||
res_ruimte rr,
|
||||
res_ruimte_opstelling ro,
|
||||
(SELECT
|
||||
rr.res_rsv_ruimte_key rsv_key,
|
||||
o.res_ruimte_opstel_key opstel_oud,
|
||||
DECODE (o.res_ruimte_opstel_key, 29, 121, 27, 141, 28, 221, 61, 221, 26, 225, 24, 181, 30, 224, 31, 161) opstel_nieuw,
|
||||
r.res_ruimte_nr ruimte_oud
|
||||
FROM
|
||||
res_rsv_ruimte rr,
|
||||
res_ruimte_opstelling o,
|
||||
res_ruimte r
|
||||
WHERE
|
||||
rr.res_ruimte_opstel_key = o.res_ruimte_opstel_key
|
||||
AND o.res_ruimte_key = r.res_ruimte_key
|
||||
AND rr.res_rsv_ruimte_verwijder IS NULL
|
||||
AND TRUNC(rr.res_rsv_ruimte_van) >= TO_DATE ('01-09-2025', 'DD-MM-YYYY')
|
||||
AND rr.res_ruimte_opstel_key IN (29,
|
||||
27,
|
||||
28,
|
||||
61,
|
||||
26,
|
||||
24,
|
||||
30,
|
||||
31)) x
|
||||
WHERE x.opstel_nieuw = ro.res_ruimte_opstel_key
|
||||
AND ro.res_ruimte_key = rr.res_ruimte_key;
|
||||
|
||||
BEGIN
|
||||
FOR rec IN c1
|
||||
LOOP
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_ruimte_opstel_key = rec.opstel_nieuw,
|
||||
res_rsv_ruimte_externnr = NULL
|
||||
WHERE res_rsv_ruimte_key = rec.rsv_key;
|
||||
|
||||
BEGIN
|
||||
fac.trackaction (
|
||||
'RESUPD',
|
||||
rec.rsv_key,
|
||||
6, -- Systeem
|
||||
NULL,
|
||||
'Reservering omgehangen van ' || rec.ruimte_oud || ' naar ' || rec.ruimte_nieuw || '.');
|
||||
END;
|
||||
END LOOP;
|
||||
END;
|
||||
/
|
||||
|
||||
------ 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
|
||||
Reference in New Issue
Block a user