-- Correctie op onjuist ingevoerde km stand poolauto

DEFINE thisfile = 'SGGR#55472.SQL'
DEFINE dbuser   = '^SGGR'
DEFINE custid   = 'SGGR'

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 SGGR_AUTORIT_REGISTRATIE
   SET km_uitgifte = 80301
 WHERE     km_uitgifte = 803001
       AND ins_deel_key = 2801
       AND fac_tracking_uitgifte_key = 540386;

UPDATE SGGR_AUTORIT_REGISTRATIE
   SET km_inname = 80308
 WHERE     km_inname= 803008
       AND ins_deel_key = 2801
       AND fac_tracking_uitgifte_key = 540386;

UPDATE SGGR_AUTORIT_REGISTRATIE
   SET km_inname = 80301
 WHERE     km_inname= 803001
       AND ins_deel_key = 2801
       AND fac_tracking_uitgifte_key = 539266;

UPDATE SGGR_AUTORIT_REGISTRATIE
   SET km_uitgifte = 80308
 WHERE     km_inname is null
       AND ins_deel_key = 2801
       AND fac_tracking_uitgifte_key = 551606;

COMMIT;

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