--
-- $Id$
--
--  FSN#22904: Bevriezen van gemeente tarieven 2016

DEFINE thisfile = 'BONS#22904_2018.SQL'
DEFINE dbuser   = '^BONS'
DEFINE custid   = 'BONS'

SET ECHO ON
SET DEFINE ON
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
WHENEVER SQLERROR EXIT;
SELECT adm.scriptspoolfile('&dbuser', '&thisfile') AS fcltlogfile FROM DUAL;
WHENEVER SQLERROR CONTINUE;
SPOOL &fcltlogfile
SET DEFINE OFF

------ payload begin ------
select *
from alg_onrgoedkenmerk
where alg_onrgoedkenmerk_verwijder is null
and alg_kenmerk_key in (1000, 1001, 1002)
order by alg_onrgoed_key, alg_kenmerk_key;

insert into alg_onrgoedkenmerk (alg_onrgoed_niveau, alg_onrgoed_key, alg_kenmerk_key, alg_onrgoedkenmerk_waarde, alg_onrgoedkenmerk_verwijder)
select alg_onrgoed_niveau, alg_onrgoed_key, alg_kenmerk_key, alg_onrgoedkenmerk_waarde, to_date('20181230', 'yyyymmdd')
from alg_onrgoedkenmerk
where alg_onrgoedkenmerk_verwijder is null
and alg_kenmerk_key in (1000, 1001, 1002);


------ 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

