--
-- $Id$
--
-- Script tbv naamswijziging AAFM (AAFM->Heyday)

DEFINE thisfile = 'AADS#52496.SQL'
DEFINE dbuser   = '^AA|^AQQA|^EXPO|^ASMS|^GULU|^NMMS|^RABO|^ZKHM'

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

DROP TABLE AAXX_IMP_MJOB_TASKS;

CREATE TABLE aaxx_imp_insp_mjob
(
  LOCATIECODE                   VARCHAR2(1000 BYTE),
  OBJECTOMSCHRIJVING            VARCHAR2(1000 BYTE),
  TAAKCATEGORIE                 VARCHAR2(1000 BYTE),
  TAAKOMSCHRIJVING              VARCHAR2(1000 BYTE),
  TAAKOPMERKING                 VARCHAR2(1000 BYTE),
  TAAKPRIORITEIT                VARCHAR2(1000 BYTE),
  TAAKBTW                       VARCHAR2(1000 BYTE),
  TAAKKOSTENPLAATSNR            VARCHAR2(1000 BYTE),
  TAAKKOSTENPLAATSOMSCHRIJVING  VARCHAR2(1000 BYTE),
  TAAKOBJECTPERCENTAGE          VARCHAR2(1000 BYTE),
  TAAKOBJECTOPMERKING           VARCHAR2(1000 BYTE),
  TAAKOBJECTPERIODE             VARCHAR2(1000 BYTE),
  TAAKOBJECTSTARTJAAR           VARCHAR2(1000 BYTE),
  TAAKOBJECTEINDJAAR            VARCHAR2(1000 BYTE),
  TAAKOBJECTMATERIAAL           VARCHAR2(1000 BYTE),
  TAAKOBJECTKOSTEN              VARCHAR2(1000 BYTE),
  TAAKOBJECTEENHEID             VARCHAR2(1000 BYTE),
  DEEL_KEY                      NUMBER(10),
  DISCIPLINE_KEY                NUMBER(10),
  ISMJOB                        NUMBER
);

INSERT INTO fac_import_app (fac_import_app_code,
                            fac_import_app_oms,
                            fac_functie_key,
                            fac_import_app_prefix,
                            fac_import_app_action)
     VALUES ('INSP_MJOB',
             'AAXX: Importeren inspecties/MJOB',
             (SELECT fac_functie_key FROM fac_functie WHERE fac_functie_code = 'WEB_IMPORT'),
             'AAXX',
             'ORACLE');

------ payload end   ------

SET DEFINE OFF
BEGIN adm.systrackscriptId ('$Id$', 0); END;
/

COMMIT;
SET ECHO OFF
SPOOL OFF
SET DEFINE ON
PROMPT Logfile of this upgrade is: &fcltlogfile