SET ECHO ON
SPOOL pnbr#34643.lst
SET DEFINE OFF


INSERT INTO fac_import_app (fac_import_app_code,
                            fac_import_app_oms,
                            fac_import_app_xsl,
                            fac_functie_key,
                            fac_import_app_charset,
                            fac_import_app_prefix,
                            fac_import_app_action)
    VALUES ('INS_MUT',
            'PNBR: Inlezen objectenbestand',
            'xsl/prs.xsl',
            74,
            'UTF-8',
            'PNBR',
            'ORACLE');

INSERT INTO fac_api (fac_api_name,
                     fac_api_filepath,
                     fac_import_app_key,
                     fac_api_options_json)
   SELECT 'INS_MUT',
          'appl/API/api_gen_import.asp',
          fac_import_app_key,
          '{"import_app_key":' || fac_import_app_key || '}'
     FROM fac_import_app
    WHERE fac_import_app_code = 'INS_MUT';

-- Voeg een gebruiker toe om de api uit te voeren

INSERT INTO prs_perslid (prs_perslid_module,
                         prs_srtperslid_key,
                         prs_afdeling_key,
                         prs_perslid_naam,
                         prs_perslid_oslogin,
                         prs_perslid_apikey,
                         prs_perslid_flags,
                         prs_perslid_systeemadres)
   SELECT 'PRS',
          1,                                                       -- Onbekend
          MIN (prs_afdeling_key),
          'API user tbv. Objecten-koppeling',
          '_INS_MUT',
          'zrfQXEVJgVIOElGDhgjvGgHzTWvhmsuM',
          4,
          NULL
     FROM prs_afdeling
    WHERE prs_afdeling_naam = 'Onbekend';
    
BEGIN adm.systrackscriptId('$Id$', 0); END;
/

COMMIT;
SPOOL OFF;
