--
-- $Id$
--
-- Customer specific once-script UWVA#79055.
DEFINE thisfile = 'UWVA#79055.SQL'
DEFINE dbuser   = '^UWVA'

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

------ payload begin ------

-- UWVA#79055:
/*
SELECT prs_perslid_nr, SUBSTR (prs_perslid_nr, 3), prs_perslid_verwijder
  FROM prs_perslid
 WHERE prs_perslid_verwijder IS NULL
       --AND SUBSTR (prs_perslid_nr,2,1) = '-'
       AND SUBSTR (prs_perslid_nr, 1, 1) IN ('C', 'I', 'E', 'F', 'D', 'K', 'W', 'P', 'S');
*/
UPDATE prs_perslid
   SET prs_perslid_nr = SUBSTR (prs_perslid_nr, 3)
 WHERE prs_perslid_verwijder IS NULL
       AND SUBSTR (prs_perslid_nr,2,1) = '-'
       AND SUBSTR (prs_perslid_nr, 1, 1) IN ('C', 'I', 'E', 'F', 'D', 'K', 'W', 'P', 'S');

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

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

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