--
-- $Id$
--
-- Script containing customer specific sql statements for the STCH database

DEFINE thisfile = 'STCH#54706-5.SQL'
DEFINE dbuser   = 'STCH'

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 ------
        
-- Rename AASI naar STCH t.b.v HV rapportages       
ALTER TABLE
aasi_hv_freeze
RENAME TO stch_hv_freeze;

-- Oude views droppen, deze zitten nu in STCH.sql
DROP VIEW AASI_V_DWH_HV_FREEZE;
DROP VIEW AASI_V_HV_ACTUAL;
DROP VIEW AASI_V_HV_DETAIL;
DROP VIEW AASI_V_RAP_AUTH_BESTELLERS;
DROP VIEW AASI_V_RAP_HV_ACTUAL;
DROP VIEW AASI_V_RAP_HV_AFD_TOTALEN;
DROP VIEW AASI_V_RAP_HV_CHECK;
DROP VIEW AASI_V_RAP_HV_DOORBEL_DELTA;
DROP VIEW AASI_V_RAP_HV_FREEZE;
DROP VIEW AAXX_V_RAP_OFFERTE_STATUS;

-- Invalid package droppen
DROP PACKAGE AAXX_RAP;

-- Overgebleven procedures droppen, mochten ze al niet weg zijn
DROP PROCEDURE AASI_EXPORT_BUNDEL_CATERING;
DROP PROCEDURE AASI_EXPORT_EXACT_VERKOOP;
DROP PROCEDURE AASI_EXPORT_EXACT_VERKOOP_VJ;
DROP PROCEDURE AASI_EXPORT_VERWERK_EXACT;
DROP PROCEDURE AASI_EXPORT_VERWERK_EXACT_UREN;
DROP PROCEDURE AASI_IMPORT_RUIMTE;
DROP PROCEDURE AASI_SELECT_EXACT_UREN;
DROP PROCEDURE AASI_SELECT_EXACT_VERKOOP;
DROP PROCEDURE AASI_SELECT_EXACT_VERKOOP_VJ;
DROP PROCEDURE AASI_SELECT_VERWERK_EXACT;
DROP PROCEDURE AASI_UPDATE_RUIMTE;
DROP PROCEDURE AASI_EXPORT_HV_FREEZE;

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

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

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