--
-- $Id$
--
-- Gebruikers email kopieren naar login

DEFINE thisfile = 'AADS#53430_2.SQL'
DEFINE dbuser   = '^AADS'
DEFINE custid   = 'AADS'

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

-- Kopieer email adres naar login voor alle personen met functie 'DSM Delft Default User'

UPDATE prs_perslid
   SET prs_perslid_oslogin = substr(prs_perslid_email, 1, 30)
 WHERE     prs_perslid_verwijder IS NULL
       AND prs_srtperslid_key = 15066               --- DSM Delft Default User
       AND prs_perslid_email IS NOT NULL
       AND prs_perslid_oslogin IS NULL;

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

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

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