--
-- $Id$
--
-- <<Korte omschrijving wat het script doet>>

DEFINE thisfile = 'AAAH#38161.SQL'
DEFINE dbuser   = '^AAAH'
DEFINE custid   = 'AAAH'

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

DELETE FROM bes_bestelopdr_item
      WHERE bes_bestelopdr_item_key IN (SELECT boi.bes_bestelopdr_item_key
                                          FROM bes_bestelopdr bo,
                                               bes_bestelopdr_item boi
                                         WHERE bo.bes_bestelopdr_key = boi.bes_bestelopdr_key
                                           AND bo.bes_bestelopdr_key = 1605);

DELETE FROM bes_bestelopdr
      WHERE bes_bestelopdr_key = 1605;


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