FCLT#76748 Underscore escapen, anders wordt een mutatie mogelijk op meerdere reserveringen uitgevoerd

svn path=/Database/branches/DB44/; revision=59384
This commit is contained in:
2023-03-01 12:11:46 +00:00
parent 75d5deb348
commit fd28edc6a8

View File

@@ -603,7 +603,7 @@ AS
res_rsv_ruimte rr
WHERE rr.res_rsv_ruimte_externnr IS NOT NULL
AND rr.res_rsv_ruimte_externnr LIKE
i.appt_id || '|' || i.recur_id || '|%'
REPLACE(i.appt_id || '|' || i.recur_id || '|%', '_', '\_') ESCAPE '\'
AND rr.res_rsv_ruimte_verwijder IS NULL
UNION ALL
SELECT 'Unknown room' reden, i.*, rr.*
@@ -621,7 +621,7 @@ AS
AND gelukt IS NULL) i,
res_rsv_ruimte rr
WHERE rr.res_rsv_ruimte_externnr LIKE
i.appt_id || '|' || i.recur_id || '|%'
REPLACE(i.appt_id || '|' || i.recur_id || '|%', '_', '\_') ESCAPE '\'
AND rr.res_rsv_ruimte_verwijder IS NULL
AND NOT EXISTS
(SELECT 1
@@ -648,7 +648,7 @@ AS
AND recur_id IS NOT NULL
AND gelukt IS NULL) i,
res_rsv_ruimte rr
WHERE rr.res_rsv_ruimte_externnr LIKE i.appt_id || '||%'
WHERE rr.res_rsv_ruimte_externnr LIKE REPLACE(i.appt_id || '||%', '_', '\_') ESCAPE '\'
AND rr.res_rsv_ruimte_verwijder IS NULL;
-- TODO: Voor later: res_cat_t1 en res_t1 gebruiken ipv TRUNC
@@ -782,7 +782,7 @@ AS
res_rsv_ruimte rr,
res_ruimte rnew
WHERE rr.res_rsv_ruimte_externnr LIKE
i.appt_id || '|' || i.recur_id || '|%'
REPLACE(i.appt_id || '|' || i.recur_id || '|%', '_', '\_') ESCAPE '\'
AND rr.res_rsv_ruimte_verwijder IS NULL
AND rnew.res_ruimte_extern_id = i.room_id
AND rnew.res_ruimte_verwijder IS NULL;
@@ -868,7 +868,7 @@ AS
res_ruimte r
WHERE rr.res_rsv_ruimte_externnr IS NOT NULL
AND rr.res_rsv_ruimte_externnr LIKE
i.appt_id || '|' || i.recur_id || '|%'
REPLACE(i.appt_id || '|' || i.recur_id || '|%', '_', '\_') ESCAPE '\'
AND rr.res_rsv_ruimte_verwijder IS NULL
AND ro.res_ruimte_opstel_key =
rr.res_ruimte_opstel_key
@@ -914,7 +914,7 @@ AS
AND NOT EXISTS
(SELECT 1
FROM res_rsv_ruimte
WHERE res_rsv_ruimte_externnr LIKE i.appt_id || '|%');
WHERE res_rsv_ruimte_externnr LIKE REPLACE(i.appt_id || '|%', '_', '\_') ESCAPE '\');
FOR rec IN c_del
LOOP
@@ -1070,7 +1070,7 @@ AS
(SELECT 1
FROM res_rsv_ruimte
WHERE res_rsv_ruimte_externnr LIKE
i.appt_id || '|' || i.recur_id || '|%');
REPLACE(i.appt_id || '|' || i.recur_id || '|%', '_', '\_') ESCAPE '\');
-- Dan bestaande bijwerken, anders kan het gebeuren dat we op basis van een UPDATE
-- eerst een rsv_ruimte aanmaken en 'm daarna meteen proberen bij te werken.
@@ -1118,7 +1118,7 @@ AS
INTO v_count_all_booked
FROM res_rsv_ruimte rr
WHERE rr.res_rsv_ruimte_externnr LIKE
rec.appt_id || '|' || rec.recur_id || '|%'
REPLACE(rec.appt_id || '|' || rec.recur_id || '|%', '_', '\_') ESCAPE '\'
AND rr.res_rsv_ruimte_verwijder IS NULL;
v_errorhint := 'Totaal aantal benodigde zalen bepalen';
@@ -1128,7 +1128,7 @@ AS
FROM exc_import i
WHERE i.modifier IN ('U', 'C')
AND i.starttime > SYSDATE
AND i.appt_id || '|' || i.recur_id || '|' LIKE
AND i.appt_id || '|' || i.recur_id || '|' =
rec.appt_id || '|' || rec.recur_id || '|';
-- De cursor bevat voor iedere appointment alle rsv_ruimtes met dezelfde appt_id en recur_id.
@@ -1142,7 +1142,7 @@ AS
res_ruimte_opstelling rops,
res_ruimte r
WHERE rr.res_rsv_ruimte_externnr LIKE
rec.appt_id || '|' || rec.recur_id || '|%'
REPLACE(rec.appt_id || '|' || rec.recur_id || '|%', '_', '\_') ESCAPE '\'
AND rr.res_rsv_ruimte_verwijder IS NULL
AND rops.res_ruimte_opstel_key = rr.res_ruimte_opstel_key
AND r.res_ruimte_key = rops.res_ruimte_key
@@ -1469,7 +1469,7 @@ AS
INTO v_count
FROM res_rsv_ruimte
WHERE res_rsv_ruimte_externnr IS NOT NULL
AND res_rsv_ruimte_externnr LIKE rec.appt_id || '|%'
AND res_rsv_ruimte_externnr LIKE REPLACE(rec.appt_id || '|%', '_', '\_') ESCAPE '\'
-- AND res_rsv_ruimte_externnr NOT LIKE '%|'||rec.recur_id||'|%'
AND res_rsv_ruimte_verwijder IS NULL;
@@ -1485,7 +1485,7 @@ AS
FROM res_rsv_ruimte
WHERE res_rsv_ruimte_externnr IS NOT NULL
AND res_rsv_ruimte_externnr LIKE
rec.appt_id || '|%'
REPLACE(rec.appt_id || '|%', '_', '\_') ESCAPE '\'
-- AND res_rsv_ruimte_externnr NOT LIKE '%|'||rec.recur_id||'|%'
AND res_rsv_ruimte_verwijder IS NULL
GROUP BY res_reservering_key;
@@ -1711,7 +1711,7 @@ AS
res_rsv_ruimte_volgnr
FROM res_rsv_ruimte rr, res_ruimte_opstelling ro, res_ruimte r
WHERE rr.res_rsv_ruimte_externnr IS NOT NULL
AND INSTR(rr.res_rsv_ruimte_externnr, rr.res_rsv_ruimte_externnr2) IS NULL -- Sluit Facilitor initiated reserveringen uit by S(msgraph_sync_level) = 3
AND INSTR(rr.res_rsv_ruimte_externnr, rr.res_rsv_ruimte_externnr2) IS NULL -- Sluit Facilitor reserveringen uit bij S(msgraph_sync_level) = 3
AND rr.res_rsv_ruimte_verwijder IS NULL
AND rr.res_rsv_ruimte_van >=
(SELECT MIN (starttime) FROM this_import)
@@ -1724,11 +1724,7 @@ AS
AND NOT EXISTS
(SELECT 1
FROM this_import i
WHERE rr.res_rsv_ruimte_externnr LIKE
i.appt_id
|| '|'
|| i.recur_id
|| '|%'
WHERE rr.res_rsv_ruimte_externnr LIKE REPLACE(i.appt_id || '|' || i.recur_id || '|%', '_', '\_') ESCAPE '\'
AND r.res_ruimte_extern_id = i.room_id))
LOOP
v_errorhint :=