SINN#77704 -- SINNE en M2-besteding en Eigenaarschap - post-script voor fip-import ivm m2 die niet weggeschreven worden in ruimte-record
svn path=/Customer/; revision=64160
This commit is contained in:
88
onces/SINN/SINN#77704_m2_post_fac_update_onrgoed2.sql
Normal file
88
onces/SINN/SINN#77704_m2_post_fac_update_onrgoed2.sql
Normal file
@@ -0,0 +1,88 @@
|
||||
--
|
||||
-- $Id$
|
||||
--
|
||||
-- Korte beschrijving wat het script doet
|
||||
---- Bij FIP fac_update_onrgoed2 worden de aangepast M2 niet doorgezet naar
|
||||
|
||||
--
|
||||
DEFINE thisfile = 'SINN#77704_m2_post_fac_update_onrgoed2.SQL'
|
||||
DEFINE dbuser = 'SINN'
|
||||
|
||||
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
|
||||
v_errormsg VARCHAR (200);
|
||||
v_errorhint VARCHAR (200);
|
||||
oracle_err_num NUMBER;
|
||||
oracle_err_mes VARCHAR2 (150);
|
||||
currentversion fac_module.fac_module_version%TYPE;
|
||||
v_aanduiding VARCHAR (100);
|
||||
v_count NUMBER;
|
||||
|
||||
CURSOR c
|
||||
IS
|
||||
SELECT i.alg_ruimte_nr,
|
||||
i.alg_ruimte_bruto_vloeropp m2_import,
|
||||
r.alg_ruimte_key,
|
||||
r.alg_ruimte_bruto_vloeropp
|
||||
FROM fac_imp_onrgoed2 i,
|
||||
alg_v_allonrgoed_gegevens v,
|
||||
alg_locatie l,
|
||||
alg_ruimte r
|
||||
WHERE v.alg_locatie_key = l.alg_locatie_key
|
||||
AND v.alg_ruimte_key = r.alg_ruimte_key
|
||||
AND i.alg_locatie_code = l.alg_locatie_code
|
||||
AND i.alg_gebouw_code = v.alg_gebouw_code
|
||||
AND i.alg_verdieping_volgnr = v.alg_verdieping_code
|
||||
AND i.alg_ruimte_nr = v.alg_ruimte_nr
|
||||
AND i.alg_ruimte_bruto_vloeropp <> r.alg_ruimte_bruto_vloeropp
|
||||
;
|
||||
|
||||
|
||||
BEGIN
|
||||
|
||||
FOR rec IN c
|
||||
LOOP
|
||||
BEGIN
|
||||
|
||||
v_errorhint := 'Updaten m2 ruimtekaart: ' || to_char(rec.alg_ruimte_key);
|
||||
|
||||
UPDATE alg_ruimte
|
||||
SET alg_ruimte_bruto_vloeropp = rec.m2_import
|
||||
WHERE alg_ruimte_key = rec.alg_ruimte_key ;
|
||||
|
||||
-- logging
|
||||
BEGIN fac.trackaction('ALGRUP', rec.alg_ruimte_key, 3, NULL, 'Uit FIP-import - BVO (m2): ' || TO_CHAR(rec.alg_ruimte_bruto_vloeropp) || ' --> ' || TO_CHAR(rec.m2_import)); END;
|
||||
|
||||
|
||||
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