Merge DB44c&d patches
svn path=/Database/trunk/; revision=59814
This commit is contained in:
@@ -86,7 +86,7 @@ AS
|
||||
CASE
|
||||
WHEN di.ins_deelsrtcontrole_status = 2
|
||||
AND di.ins_deelsrtcontrole_datum_org IS NULL
|
||||
THEN
|
||||
THEN -- Gestart(2) en de allereerste inspectie.
|
||||
-- Periodieke taken:
|
||||
-- De startdatum is MAX(startdatum, aanmaakdatum/registratiedatum) en heeft altijd een waarde (ins_deel_aanmaak is altijd gevuld).
|
||||
-- Er is nog geen inspectie geweest en de startdatum is ingevuld of de registratiedatum ligt in de toekomst.
|
||||
@@ -253,11 +253,21 @@ AS
|
||||
ELSE
|
||||
0
|
||||
END,
|
||||
0) --Er geldt dat (ctr_ismjob = 0), dus de eerste when is toch niet geldig.
|
||||
0) -- Er geldt dat (ctr_ismjob = 0), dus de eerste when is toch niet geldig.
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
WHEN di.ins_deelsrtcontrole_status = 2
|
||||
AND di.ins_deelsrtcontrole_datum_org IS NOT NULL
|
||||
THEN -- Gestart(2) en niet de allereerste inspectie.
|
||||
di.ins_deelsrtcontrole_datum_org
|
||||
ELSE -- Status is Gereed gemeld(5) of Voltooid(6).
|
||||
CASE xcp.ins_srtcontrole_mode
|
||||
WHEN 0
|
||||
THEN -- Moment mode: ga uit van de originele berekende inspectiedatum.
|
||||
di.ins_deelsrtcontrole_datum_org
|
||||
ELSE -- Interval mode: ga uit van de werkelijke inspectiedatum.
|
||||
di.ins_deelsrtcontrole_datum
|
||||
END
|
||||
END) volgendedatum,
|
||||
discipline,
|
||||
soort,
|
||||
|
||||
164
EXC/EXC_PAC.SRC
164
EXC/EXC_PAC.SRC
@@ -296,8 +296,15 @@ AS
|
||||
|
||||
-- We willen mislukte regels uit eerdere imports bewaren, zodat we die nog eens kunnen proberen.
|
||||
-- Alle correct verwerkte importregels krijgen een vlag, dus die gooien we weg.
|
||||
-- Deletes die al deleted zijn, zijn schijnbaar al gelukt
|
||||
DELETE FROM exc_import
|
||||
WHERE gelukt IS NOT NULL;
|
||||
WHERE gelukt IS NOT NULL
|
||||
OR ( modifier = 'D'
|
||||
AND EXISTS
|
||||
(SELECT 1
|
||||
FROM res_rsv_ruimte
|
||||
WHERE res_rsv_ruimte_verwijder IS NOT NULL
|
||||
AND res_rsv_ruimte_externnr = appt_id || '|' || recur_id));
|
||||
|
||||
-- We gaan uit van een geldig bestand, mogelijk verandert dat onderweg
|
||||
header_is_valid := 0;
|
||||
@@ -601,9 +608,7 @@ AS
|
||||
WHERE modifier = 'D'
|
||||
AND gelukt IS NULL) i,
|
||||
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 || '|%'
|
||||
WHERE rr.res_rsv_ruimte_externnr = i.appt_id || '|' || i.recur_id
|
||||
AND rr.res_rsv_ruimte_verwijder IS NULL
|
||||
UNION ALL
|
||||
SELECT 'Unknown room' reden, i.*, rr.*
|
||||
@@ -620,8 +625,7 @@ AS
|
||||
AND starttime > SYSDATE
|
||||
AND gelukt IS NULL) i,
|
||||
res_rsv_ruimte rr
|
||||
WHERE rr.res_rsv_ruimte_externnr LIKE
|
||||
i.appt_id || '|' || i.recur_id || '|%'
|
||||
WHERE rr.res_rsv_ruimte_externnr = i.appt_id || '|' || i.recur_id
|
||||
AND rr.res_rsv_ruimte_verwijder IS NULL
|
||||
AND NOT EXISTS
|
||||
(SELECT 1
|
||||
@@ -648,7 +652,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 = i.appt_id || '|'
|
||||
AND rr.res_rsv_ruimte_verwijder IS NULL;
|
||||
|
||||
-- TODO: Voor later: res_cat_t1 en res_t1 gebruiken ipv TRUNC
|
||||
@@ -781,8 +785,7 @@ AS
|
||||
modifier) i,
|
||||
res_rsv_ruimte rr,
|
||||
res_ruimte rnew
|
||||
WHERE rr.res_rsv_ruimte_externnr LIKE
|
||||
i.appt_id || '|' || i.recur_id || '|%'
|
||||
WHERE rr.res_rsv_ruimte_externnr = i.appt_id || '|' || i.recur_id
|
||||
AND rr.res_rsv_ruimte_verwijder IS NULL
|
||||
AND rnew.res_ruimte_extern_id = i.room_id
|
||||
AND rnew.res_ruimte_verwijder IS NULL;
|
||||
@@ -866,15 +869,14 @@ AS
|
||||
FROM res_rsv_ruimte rr,
|
||||
res_ruimte_opstelling ro,
|
||||
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 || '|%'
|
||||
WHERE rr.res_rsv_ruimte_externnr = i.appt_id || '|' || i.recur_id
|
||||
AND rr.res_rsv_ruimte_verwijder IS NULL
|
||||
AND ro.res_ruimte_opstel_key =
|
||||
rr.res_ruimte_opstel_key
|
||||
AND r.res_ruimte_key = ro.res_ruimte_key
|
||||
AND r.res_ruimte_verwijder IS NULL
|
||||
AND r.res_ruimte_extern_id = i.room_id);
|
||||
AND r.res_ruimte_extern_id = i.room_id)
|
||||
ORDER BY 9;
|
||||
BEGIN
|
||||
SELECT BITAND (COALESCE (fac_setting_pvalue, fac_setting_default), 4)
|
||||
INTO sync_level
|
||||
@@ -914,7 +916,7 @@ AS
|
||||
AND NOT EXISTS
|
||||
(SELECT 1
|
||||
FROM res_rsv_ruimte
|
||||
WHERE res_rsv_ruimte_externnr LIKE i.appt_id || '|%');
|
||||
WHERE INSTR(res_rsv_ruimte_externnr, i.appt_id || '|') = 1);
|
||||
|
||||
FOR rec IN c_del
|
||||
LOOP
|
||||
@@ -1069,8 +1071,7 @@ AS
|
||||
AND NOT EXISTS
|
||||
(SELECT 1
|
||||
FROM res_rsv_ruimte
|
||||
WHERE res_rsv_ruimte_externnr LIKE
|
||||
i.appt_id || '|' || i.recur_id || '|%');
|
||||
WHERE res_rsv_ruimte_externnr = i.appt_id || '|' || i.recur_id);
|
||||
|
||||
-- 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.
|
||||
@@ -1117,8 +1118,7 @@ AS
|
||||
SELECT COUNT (*)
|
||||
INTO v_count_all_booked
|
||||
FROM res_rsv_ruimte rr
|
||||
WHERE rr.res_rsv_ruimte_externnr LIKE
|
||||
rec.appt_id || '|' || rec.recur_id || '|%'
|
||||
WHERE rr.res_rsv_ruimte_externnr = rec.appt_id || '|' || rec.recur_id
|
||||
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.
|
||||
@@ -1141,8 +1141,7 @@ AS
|
||||
FROM res_rsv_ruimte rr,
|
||||
res_ruimte_opstelling rops,
|
||||
res_ruimte r
|
||||
WHERE rr.res_rsv_ruimte_externnr LIKE
|
||||
rec.appt_id || '|' || rec.recur_id || '|%'
|
||||
WHERE rr.res_rsv_ruimte_externnr = rec.appt_id || '|' || rec.recur_id
|
||||
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 +1468,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 INSTR(res_rsv_ruimte_externnr, rec.appt_id || '|') = 1
|
||||
-- AND res_rsv_ruimte_externnr NOT LIKE '%|'||rec.recur_id||'|%'
|
||||
AND res_rsv_ruimte_verwijder IS NULL;
|
||||
|
||||
@@ -1483,9 +1482,8 @@ AS
|
||||
MAX (res_rsv_ruimte_volgnr) + 1
|
||||
INTO v_reservering_key, v_rsv_ruimte_volgnr
|
||||
FROM res_rsv_ruimte
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_externnr LIKE
|
||||
rec.appt_id || '|%'
|
||||
WHERE INSTR(res_rsv_ruimte_externnr,
|
||||
rec.appt_id || '|') = 1
|
||||
-- AND res_rsv_ruimte_externnr NOT LIKE '%|'||rec.recur_id||'|%'
|
||||
AND res_rsv_ruimte_verwijder IS NULL
|
||||
GROUP BY res_reservering_key;
|
||||
@@ -1521,48 +1519,67 @@ AS
|
||||
|
||||
v_errorhint := 'Deelreservering aanmaken';
|
||||
|
||||
-- res_rsv_ruimte aanmaken voor deze appointment+resource
|
||||
INSERT INTO res_rsv_ruimte (res_rsv_ruimte_omschrijving,
|
||||
res_rsv_ruimte_opmerking,
|
||||
res_rsv_ruimte_externnr,
|
||||
res_ruimte_opstel_key,
|
||||
res_rsv_ruimte_van,
|
||||
res_rsv_ruimte_tot,
|
||||
prs_kostenplaats_key,
|
||||
res_rsv_ruimte_host_key,
|
||||
res_activiteit_key,
|
||||
res_status_fo_key,
|
||||
res_rsv_ruimte_ordernr,
|
||||
res_rsv_ruimte_kosten_klant,
|
||||
res_rsv_ruimte_contact_key,
|
||||
res_rsv_ruimte_bezoekers,
|
||||
res_reservering_key,
|
||||
res_rsv_ruimte_volgnr,
|
||||
res_status_bo_key)
|
||||
VALUES (
|
||||
SUBSTR (rec.subject, 1, 60),
|
||||
NULL,
|
||||
rec.appt_id
|
||||
|| '|'
|
||||
|| rec.recur_id
|
||||
|| '|'
|
||||
|| rec.seq_nr,
|
||||
v_ruimte_opstel_key,
|
||||
rec.starttime,
|
||||
rec.endtime,
|
||||
v_kostenplaats_key,
|
||||
v_perslid_key,
|
||||
c_activiteit_key,
|
||||
2,
|
||||
NULL,
|
||||
1,
|
||||
v_perslid_key,
|
||||
rec.num_bez,
|
||||
v_reservering_key,
|
||||
v_rsv_ruimte_volgnr,
|
||||
2)
|
||||
RETURNING res_rsv_ruimte_key
|
||||
INTO v_rsv_ruimte_key;
|
||||
BEGIN
|
||||
-- res_rsv_ruimte aanmaken voor deze appointment+resource
|
||||
INSERT INTO res_rsv_ruimte (res_rsv_ruimte_omschrijving,
|
||||
res_rsv_ruimte_opmerking,
|
||||
res_rsv_ruimte_externnr,
|
||||
res_ruimte_opstel_key,
|
||||
res_rsv_ruimte_van,
|
||||
res_rsv_ruimte_tot,
|
||||
prs_kostenplaats_key,
|
||||
res_rsv_ruimte_host_key,
|
||||
res_activiteit_key,
|
||||
res_status_fo_key,
|
||||
res_rsv_ruimte_ordernr,
|
||||
res_rsv_ruimte_kosten_klant,
|
||||
res_rsv_ruimte_contact_key,
|
||||
res_rsv_ruimte_bezoekers,
|
||||
res_reservering_key,
|
||||
res_rsv_ruimte_volgnr,
|
||||
res_status_bo_key)
|
||||
VALUES (
|
||||
SUBSTR (rec.subject, 1, 60),
|
||||
NULL,
|
||||
rec.appt_id
|
||||
|| '|'
|
||||
|| rec.recur_id,
|
||||
v_ruimte_opstel_key,
|
||||
rec.starttime,
|
||||
rec.endtime,
|
||||
v_kostenplaats_key,
|
||||
v_perslid_key,
|
||||
c_activiteit_key,
|
||||
2,
|
||||
NULL,
|
||||
1,
|
||||
v_perslid_key,
|
||||
rec.num_bez,
|
||||
v_reservering_key,
|
||||
v_rsv_ruimte_volgnr,
|
||||
2)
|
||||
RETURNING res_rsv_ruimte_key
|
||||
INTO v_rsv_ruimte_key;
|
||||
EXCEPTION
|
||||
WHEN DUP_VAL_ON_INDEX
|
||||
THEN -- Er bestaat al een reservering met dit externnr
|
||||
IF NOT (v_count > 0) -- Verwijder dan ook het zojuist aangemaakte res_reservering-record weer
|
||||
THEN
|
||||
DELETE FROM res_reservering WHERE res_reservering_key = v_reservering_key;
|
||||
END IF;
|
||||
-- Pas het 'gelukt' bitje aan zodat we hem later niet weer opnieuwe proberen
|
||||
UPDATE exc_import
|
||||
SET gelukt = 2
|
||||
WHERE appt_id || '|' || recur_id =
|
||||
rec.appt_id || '|' || rec.recur_id
|
||||
AND gelukt IS NULL;
|
||||
|
||||
fac.imp_writelog (p_import_key,
|
||||
'W',
|
||||
v_aanduiding,
|
||||
'Deze exacte reservering is al bekend in Facilitor -> Geen boeking.');
|
||||
CONTINUE;
|
||||
END;
|
||||
|
||||
IF (v_debug)
|
||||
THEN
|
||||
@@ -1711,7 +1728,12 @@ 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) <> 1 -- Sluit Facilitor initiated reserveringen uit by S(msgraph_sync_level) = 3
|
||||
AND ( (SELECT BITAND ( COALESCE (fac_setting_pvalue, fac_setting_default), 6)
|
||||
FROM fac_setting
|
||||
WHERE fac_setting_name = 'msgraph_sync_level') = 4
|
||||
OR ( rr.res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND rr.res_rsv_ruimte_externnr2 IS NULL
|
||||
AND rr.res_rsv_ruimte_externsyncdate IS NOT NULL))
|
||||
AND rr.res_rsv_ruimte_verwijder IS NULL
|
||||
AND rr.res_rsv_ruimte_van >=
|
||||
(SELECT MIN (starttime) FROM this_import)
|
||||
@@ -1724,11 +1746,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 = i.appt_id || '|' || i.recur_id
|
||||
AND r.res_ruimte_extern_id = i.room_id))
|
||||
LOOP
|
||||
v_errorhint :=
|
||||
|
||||
@@ -1580,7 +1580,7 @@ FAC_LCL('lcl_res_afhalen_fixed', 'Af te halen in', 'To be picked up at')
|
||||
FAC_LCL('lcl_res_bezorgen', 'Bezorgen', 'Deliver')
|
||||
FAC_LCL('lcl_res_bezorgen_fixed', 'Te bezorgen in', 'To be delivered at')
|
||||
FAC_LCL('lcl_res_standaard', 'Standaard ({0})', 'Default ({0})')
|
||||
FAC_LCL('lcl_res_ophalen', 'Ophalen', 'Pick up')
|
||||
FAC_LCL('lcl_res_ophalen', 'Afwijkende ophaaltijd', 'Deviating pick-up time')
|
||||
FAC_LCL('lcl_name', 'Naam', 'Name')
|
||||
FAC_LCL('lcl_host', 'Gastheer/vrouw', 'Host(ess)')
|
||||
FAC_LCL('lcl_requestor', 'Aanvrager', 'Requestor')
|
||||
|
||||
@@ -101,8 +101,8 @@ BEGIN
|
||||
--DBMS_OUTPUT.put_line (l_sql);
|
||||
DBMS_SQL.parse (l_cursor, l_sql, DBMS_SQL.native);
|
||||
DBMS_SQL.bind_variable (l_cursor, ':import_key', p_import_key);
|
||||
DBMS_SQL.bind_variable (l_cursor, ':rec_count', rec_count);
|
||||
END IF;
|
||||
DBMS_SQL.bind_variable (l_cursor, ':rec_count', rec.fac_imp_file_index);
|
||||
|
||||
FOR f IN 1 .. a_fields.COUNT
|
||||
LOOP
|
||||
|
||||
6
FCLT.NMK
6
FCLT.NMK
@@ -60,9 +60,9 @@ PROJEXE=z:\Project\FACILITOR\BUILD
|
||||
##
|
||||
## New style using schemanumbers
|
||||
##
|
||||
CURRENTVERSION=42
|
||||
NEXTVERSION=43
|
||||
FILEVERSION=b
|
||||
CURRENTVERSION=43
|
||||
NEXTVERSION=44
|
||||
FILEVERSION=e
|
||||
NEXTCAREVERSION=37
|
||||
NEXTROOT=DB$(NEXTVERSION)$(FILEVERSION)
|
||||
CURRENTUPDATE=DB$(CURRENTVERSION)to$(NEXTVERSION)
|
||||
|
||||
@@ -32,6 +32,14 @@ create index res_i_res_rsv_ruimte14 on res_rsv_ruimte (res_rsv_ruimte_kto_verstu
|
||||
create index res_i_res_rsv_ruimte15 on res_rsv_ruimte (res_rsv_ruimte_externnr);
|
||||
create index res_i_res_rsv_ruimte16 on res_rsv_ruimte (mld_opdr_key);
|
||||
create index res_i_res_rsv_ruimte17 on res_rsv_ruimte (res_rsv_ruimte_parent_key);
|
||||
CREATE UNIQUE INDEX res_i_res_rsv_ruimte18
|
||||
ON res_rsv_ruimte (CASE
|
||||
WHEN res_rsv_ruimte_verwijder IS NULL
|
||||
THEN
|
||||
res_rsv_ruimte_externnr
|
||||
ELSE
|
||||
NULL
|
||||
END);
|
||||
|
||||
create index res_i_res_rsv_deel2 on res_rsv_deel(res_deel_key);
|
||||
create index res_i_res_rsv_deel3 on res_rsv_deel(bez_bezoekers_key);
|
||||
|
||||
@@ -439,6 +439,55 @@ DELETE FROM fac_groeprechten
|
||||
AND f.fac_functie_code = 'WEB_ORDOAP'
|
||||
);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////// FCLT#77314
|
||||
|
||||
// Drop trigger om res_rsv_ruimte-records aan te kunnen passen in bo_status = 6
|
||||
DROP TRIGGER res_t_res_rsv_ruimte_B_IU;
|
||||
|
||||
// Strip de timestamp (ook maar voor verwijderde records)
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_rsv_ruimte_externnr =
|
||||
SUBSTR (res_rsv_ruimte_externnr, 1, LENGTH (res_rsv_ruimte_externnr) - 14)
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_externnr NOT LIKE '##iCalUId##%'
|
||||
AND REGEXP_LIKE (res_rsv_ruimte_externnr, '\|\d{13}$');
|
||||
|
||||
// Verwijder de dubbelen op een nette manier die niet de Outlook koppeling aftrapt
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_rsv_ruimte_externnr = NULL
|
||||
, res_rsv_ruimte_verwijder = SYSDATE
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_verwijder IS NULL
|
||||
AND res_rsv_ruimte_key NOT IN ( SELECT MIN (res_rsv_ruimte_key)
|
||||
FROM res_rsv_ruimte
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_verwijder IS NULL
|
||||
GROUP BY res_rsv_ruimte_externnr);
|
||||
|
||||
// Voeg de nieuwe unieke index toe
|
||||
CREATE UNIQUE INDEX res_i_res_rsv_ruimte18
|
||||
ON res_rsv_ruimte (CASE
|
||||
WHEN res_rsv_ruimte_verwijder IS NULL
|
||||
THEN
|
||||
res_rsv_ruimte_externnr
|
||||
ELSE
|
||||
NULL
|
||||
END);
|
||||
|
||||
// En voeg trigger weer toe
|
||||
CREATE OR REPLACE TRIGGER res_t_res_rsv_ruimte_B_IU
|
||||
BEFORE INSERT OR UPDATE ON res_rsv_ruimte
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF :old.res_status_bo_key=6 THEN raise_application_error(-20001, 'Reserveringsgegevens '||:new.res_rsv_ruimte_key||'/'||:new.res_rsv_ruimte_volgnr||' zijn verwerkt; wijzigen is niet meer toegestaan.'); END IF;
|
||||
BEGIN IF :new.res_rsv_ruimte_verwijder IS NOT NULL OR (:new.res_rsv_ruimte_verwijder IS NULL AND :old.res_rsv_ruimte_verwijder IS NOT NULL) THEN UPDATE res_rsv_artikel SET res_rsv_artikel_verwijder = :new.res_rsv_ruimte_verwijder WHERE res_rsv_artikel.res_rsv_ruimte_key = :new.res_rsv_ruimte_key AND res_rsv_artikel.res_rsv_artikel_verwijder IS NULL; END IF; END;
|
||||
BEGIN IF :new.res_rsv_ruimte_verwijder IS NOT NULL OR (:new.res_rsv_ruimte_verwijder IS NULL AND :old.res_rsv_ruimte_verwijder IS NOT NULL) THEN UPDATE res_rsv_deel SET res_rsv_deel_verwijder = :new.res_rsv_ruimte_verwijder WHERE res_rsv_deel.res_rsv_ruimte_key = :new.res_rsv_ruimte_key AND res_rsv_deel.res_rsv_deel_verwijder IS NULL; END IF; END;
|
||||
BEGIN IF :new.res_rsv_ruimte_verwijder IS NOT NULL THEN DELETE FROM bez_afspraak WHERE bez_afspraak.res_rsv_ruimte_key = :new.res_rsv_ruimte_key; END IF; END;
|
||||
BEGIN IF :new.res_rsv_ruimte_host_key <> :old.res_rsv_ruimte_host_key THEN UPDATE bez_afspraak set bez_afspraak_host_key = :new.res_rsv_ruimte_host_key WHERE res_rsv_ruimte_key = :new.res_rsv_ruimte_key AND bez_afspraak_host_key IS NOT NULL; END IF; END;
|
||||
BEGIN IF :new.res_rsv_ruimte_contact_key <> :old.res_rsv_ruimte_contact_key THEN UPDATE bez_afspraak set bez_afspraak_contact_key= :new.res_rsv_ruimte_contact_key WHERE res_rsv_ruimte_key =:new.res_rsv_ruimte_key; END IF; END;
|
||||
END;
|
||||
/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////// FCLT#00000
|
||||
|
||||
REGISTERONCE('$Id$')
|
||||
|
||||
68
_UP/DB44cto44d.sql
Normal file
68
_UP/DB44cto44d.sql
Normal file
@@ -0,0 +1,68 @@
|
||||
--
|
||||
-- $Id$
|
||||
--
|
||||
-- Aanpassingen om DB44c (prod) naar de DB44d te brengen
|
||||
-- Merk op dat de recreate er nog bij komt die de DB-version bijwerkt
|
||||
--
|
||||
-- MOET OOK ZIJN/WORDEN OPGENOMEN IN DB43TO44d.src !!!
|
||||
|
||||
DEFINE thisfile = 'DB44cto44d.sql'
|
||||
DEFINE dbuser = '*'
|
||||
|
||||
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 ------
|
||||
-- /////////////////////////////////////////////////////////////////////////////////////////// FCLT#73722
|
||||
|
||||
-- Strip de timestamp (ook maar voor verwijderde records)
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_rsv_ruimte_externnr =
|
||||
SUBSTR (res_rsv_ruimte_externnr, 1, LENGTH (res_rsv_ruimte_externnr) - 14)
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_externnr NOT LIKE '##iCalUId##%'
|
||||
AND REGEXP_LIKE (res_rsv_ruimte_externnr, '\|\d{13}$');
|
||||
|
||||
-- Verwijder de dubbelen op een nette manier die niet de Outlook koppeling aftrapt
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_rsv_ruimte_externnr = NULL
|
||||
, res_rsv_ruimte_verwijder = SYSDATE
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_verwijder IS NULL
|
||||
AND res_rsv_ruimte_key NOT IN ( SELECT MIN (res_rsv_ruimte_key)
|
||||
FROM res_rsv_ruimte
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_verwijder IS NULL
|
||||
GROUP BY res_rsv_ruimte_externnr);
|
||||
|
||||
-- Voeg de nieuwe unieke index toe
|
||||
CREATE UNIQUE INDEX res_i_res_rsv_ruimte18
|
||||
ON res_rsv_ruimte (CASE
|
||||
WHEN res_rsv_ruimte_verwijder IS NULL
|
||||
THEN
|
||||
res_rsv_ruimte_externnr
|
||||
ELSE
|
||||
NULL
|
||||
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
|
||||
72
_UP/DB44cto44d_2.sql
Normal file
72
_UP/DB44cto44d_2.sql
Normal file
@@ -0,0 +1,72 @@
|
||||
--
|
||||
-- $Id$
|
||||
--
|
||||
-- Aanpassingen om DB44c (prod) naar de DB44d te brengen
|
||||
-- Merk op dat de recreate er nog bij komt die de DB-version bijwerkt
|
||||
--
|
||||
-- MOET OOK ZIJN/WORDEN OPGENOMEN IN DB43TO44d.src !!!
|
||||
|
||||
DEFINE thisfile = 'DB44cto44d_2.sql'
|
||||
DEFINE dbuser = '*'
|
||||
|
||||
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 ------
|
||||
-- /////////////////////////////////////////////////////////////////////////////////////////// FCLT#77314
|
||||
|
||||
-- Strip de timestamp (ook maar voor verwijderde records)
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_rsv_ruimte_externnr =
|
||||
SUBSTR (res_rsv_ruimte_externnr, 1, LENGTH (res_rsv_ruimte_externnr) - 14)
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_externnr NOT LIKE '##iCalUId##%'
|
||||
AND REGEXP_LIKE (res_rsv_ruimte_externnr, '\|\d{13}$');
|
||||
|
||||
-- Verwijder de dubbelen op een nette manier die niet de Outlook koppeling aftrapt
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_rsv_ruimte_externnr = NULL
|
||||
, res_rsv_ruimte_verwijder = SYSDATE
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_verwijder IS NULL
|
||||
AND res_rsv_ruimte_key NOT IN ( SELECT MIN (res_rsv_ruimte_key)
|
||||
FROM res_rsv_ruimte
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_verwijder IS NULL
|
||||
GROUP BY res_rsv_ruimte_externnr)
|
||||
AND res_ruimte_opstel_key IN ( SELECT res_ruimte_opstel_key
|
||||
FROM res_ruimte_opstelling ro, res_ruimte rr
|
||||
WHERE ro.res_ruimte_key = rr.res_ruimte_key
|
||||
AND rr.res_ruimte_extern_id IS NOT NULL);
|
||||
|
||||
-- Voeg de nieuwe unieke index toe
|
||||
CREATE UNIQUE INDEX res_i_res_rsv_ruimte18
|
||||
ON res_rsv_ruimte (CASE
|
||||
WHEN res_rsv_ruimte_verwijder IS NULL
|
||||
THEN
|
||||
res_rsv_ruimte_externnr
|
||||
ELSE
|
||||
NULL
|
||||
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
|
||||
85
_UP/DB44cto44d_3.sql
Normal file
85
_UP/DB44cto44d_3.sql
Normal file
@@ -0,0 +1,85 @@
|
||||
--
|
||||
-- $Id$
|
||||
--
|
||||
-- Aanpassingen om DB44c (prod) naar de DB44d te brengen
|
||||
-- Merk op dat de recreate er nog bij komt die de DB-version bijwerkt
|
||||
--
|
||||
-- MOET OOK ZIJN/WORDEN OPGENOMEN IN DB43TO44d.src !!!
|
||||
|
||||
DEFINE thisfile = 'DB44cto44d_3.sql'
|
||||
DEFINE dbuser = '*'
|
||||
|
||||
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 ------
|
||||
-- /////////////////////////////////////////////////////////////////////////////////////////// FCLT#77314
|
||||
|
||||
-- Drop trigger om res_rsv_ruimte-records aan te kunnen passen in bo_status = 6
|
||||
DROP TRIGGER res_t_res_rsv_ruimte_B_IU;
|
||||
|
||||
-- Strip de timestamp (ook maar voor verwijderde records)
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_rsv_ruimte_externnr =
|
||||
SUBSTR (res_rsv_ruimte_externnr, 1, LENGTH (res_rsv_ruimte_externnr) - 14)
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_externnr NOT LIKE '##iCalUId##%'
|
||||
AND REGEXP_LIKE (res_rsv_ruimte_externnr, '\|\d{13}$');
|
||||
|
||||
-- Verwijder de dubbelen op een nette manier die niet de Outlook koppeling aftrapt
|
||||
UPDATE res_rsv_ruimte
|
||||
SET res_rsv_ruimte_externnr = NULL
|
||||
, res_rsv_ruimte_verwijder = SYSDATE
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_verwijder IS NULL
|
||||
AND res_rsv_ruimte_key NOT IN ( SELECT MIN (res_rsv_ruimte_key)
|
||||
FROM res_rsv_ruimte
|
||||
WHERE res_rsv_ruimte_externnr IS NOT NULL
|
||||
AND res_rsv_ruimte_verwijder IS NULL
|
||||
GROUP BY res_rsv_ruimte_externnr);
|
||||
|
||||
-- Voeg de nieuwe unieke index toe
|
||||
CREATE UNIQUE INDEX res_i_res_rsv_ruimte18
|
||||
ON res_rsv_ruimte (CASE
|
||||
WHEN res_rsv_ruimte_verwijder IS NULL
|
||||
THEN
|
||||
res_rsv_ruimte_externnr
|
||||
ELSE
|
||||
NULL
|
||||
END);
|
||||
|
||||
-- En voeg trigger weer toe
|
||||
CREATE OR REPLACE TRIGGER res_t_res_rsv_ruimte_B_IU
|
||||
BEFORE INSERT OR UPDATE ON res_rsv_ruimte
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
IF :old.res_status_bo_key=6 THEN raise_application_error(-20001, 'Reserveringsgegevens '||:new.res_rsv_ruimte_key||'/'||:new.res_rsv_ruimte_volgnr||' zijn verwerkt; wijzigen is niet meer toegestaan.'); END IF;
|
||||
BEGIN IF :new.res_rsv_ruimte_verwijder IS NOT NULL OR (:new.res_rsv_ruimte_verwijder IS NULL AND :old.res_rsv_ruimte_verwijder IS NOT NULL) THEN UPDATE res_rsv_artikel SET res_rsv_artikel_verwijder = :new.res_rsv_ruimte_verwijder WHERE res_rsv_artikel.res_rsv_ruimte_key = :new.res_rsv_ruimte_key AND res_rsv_artikel.res_rsv_artikel_verwijder IS NULL; END IF; END;
|
||||
BEGIN IF :new.res_rsv_ruimte_verwijder IS NOT NULL OR (:new.res_rsv_ruimte_verwijder IS NULL AND :old.res_rsv_ruimte_verwijder IS NOT NULL) THEN UPDATE res_rsv_deel SET res_rsv_deel_verwijder = :new.res_rsv_ruimte_verwijder WHERE res_rsv_deel.res_rsv_ruimte_key = :new.res_rsv_ruimte_key AND res_rsv_deel.res_rsv_deel_verwijder IS NULL; END IF; END;
|
||||
BEGIN IF :new.res_rsv_ruimte_verwijder IS NOT NULL THEN DELETE FROM bez_afspraak WHERE bez_afspraak.res_rsv_ruimte_key = :new.res_rsv_ruimte_key; END IF; END;
|
||||
BEGIN IF :new.res_rsv_ruimte_host_key <> :old.res_rsv_ruimte_host_key THEN UPDATE bez_afspraak set bez_afspraak_host_key = :new.res_rsv_ruimte_host_key WHERE res_rsv_ruimte_key = :new.res_rsv_ruimte_key AND bez_afspraak_host_key IS NOT NULL; END IF; END;
|
||||
BEGIN IF :new.res_rsv_ruimte_contact_key <> :old.res_rsv_ruimte_contact_key THEN UPDATE bez_afspraak set bez_afspraak_contact_key= :new.res_rsv_ruimte_contact_key WHERE res_rsv_ruimte_key =:new.res_rsv_ruimte_key; END IF; END;
|
||||
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