--
-- $Id$
--
-- Script containing customer specific sql statements for the YKPN database
-- Import tabel en importfunctie t.b.v. de KPI module

DEFINE thisfile = 'YKPN#54702.SQL'
DEFINE dbuser   = '^YKPN'

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

BEGIN
FAC.INITSESSION('NL');
END;
/

CREATE TABLE YKPN_IMP_KPI_DEFINITIE
(
  KPI_DEFINITIE_CODE          VARCHAR2(255),
  KPI_DEFINITIE_OMSCHRIJVING  VARCHAR2(255),
  KPI_DEFINITIE_INFO          VARCHAR2(4000),
  KPI_DEFINITIE_CATEGORIE1    VARCHAR2(255),
  KPI_DEFINITIE_CATEGORIE2    VARCHAR2(255),
  KPI_DEFINITIE_CATEGORIE3    VARCHAR2(255),
  KPI_DEFINITIE_DREMPELS      VARCHAR2(255)  
);


INSERT INTO fac_import_app
            (fac_import_app_code, fac_import_app_oms,
             fac_functie_key, fac_import_app_prefix)
   SELECT 'KPI_DEFINITIE', 'FIP: KPI Definitie',
          fac_functie_key, 'YKPN'
     FROM fac_functie
    WHERE fac_functie_code = 'WEB_PRSSYS';
    
------ 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