--
-- $Id$
--
-- Bezoekers die niet zijn UIT-gemeld eenmalig allemaal uitmelden

DEFINE thisfile = 'YKPN#56012.sql'
DEFINE dbuser   = '^YKPN'
DEFINE custid   = '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 ------

UPDATE bez_bezoekers
   SET bez_bezoekers_out = SYSDATE
 WHERE     bez_bezoekers_done IS NOT NULL
       AND bez_bezoekers_out IS NULL
       AND TRUNC (bez_bezoekers_done) < TRUNC (SYSDATE);

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