-- Script containing customer specific configuration sql statements for De Blije Borgh
-- $Revision$
-- $Id$

DEFINE thisfile = 'BLIJ.SQL'
DEFINE dbuser   = '^BLIJ'
DEFINE custid   = 'BLIJ'

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

CREATE OR REPLACE VIEW blij_v_rap_persons
(
   perslid_key,
   naam,
   naam_friendly
)
AS
     SELECT p.prs_perslid_key,
            pfn.prs_perslid_naam_full,
            pfn.prs_perslid_naam_friendly
       FROM prs_v_aanwezigperslid p,
            prs_v_perslid_fullnames pfn,
            prs_srtperslid fun
      WHERE     fun.prs_srtperslid_key = p.prs_srtperslid_key
            AND pfn.prs_perslid_key = p.prs_perslid_key
            AND (p.prs_perslid_naam) NOT LIKE 'API-user%'
            AND p.prs_perslid_naam NOT LIKE '%Facilitor%'
            AND UPPER (fun.prs_srtperslid_omschrijving) NOT LIKE
                  '%ALGEMEEN ACCOUNT%'
   ORDER BY pfn.prs_perslid_naam_full;

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