SCBR#56610: Dag overzicht poolauto's
svn path=/Customer/trunk/; revision=41194
This commit is contained in:
108
SCBR/SCBR.sql
Normal file
108
SCBR/SCBR.sql
Normal file
@@ -0,0 +1,108 @@
|
||||
--
|
||||
-- $Id$
|
||||
--
|
||||
-- Script containing customer specific sql statements for the FACILITOR database
|
||||
|
||||
DEFINE thisfile = 'SCBR.SQL'
|
||||
DEFINE dbuser = '^SCBR'
|
||||
|
||||
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 ------
|
||||
|
||||
CREATE OR REPLACE VIEW SCBR_V_RAP_DAGOVERZICHT
|
||||
(
|
||||
NUMMER,
|
||||
GASTHEER,
|
||||
VAN,
|
||||
TOT,
|
||||
DUUR,
|
||||
ACTIVITEIT,
|
||||
ACTIVITEITSOORT,
|
||||
VOORZIENING_CATALOGUS,
|
||||
VOORZIENING_PRODUCT,
|
||||
PARAAF
|
||||
)
|
||||
AS
|
||||
SELECT res.res_reservering_key || '/' || rrr.res_rsv_ruimte_volgnr,
|
||||
(SELECT prs_perslid_naam_full
|
||||
FROM prs_v_perslid_fullnames_all pf
|
||||
WHERE pf.prs_perslid_key = rrr.res_rsv_ruimte_host_key),
|
||||
rrr.res_rsv_ruimte_van,
|
||||
rrr.res_rsv_ruimte_tot,
|
||||
COALESCE ((rrr.res_rsv_ruimte_tot - rrr.res_rsv_ruimte_van) * 24,
|
||||
0),
|
||||
ra.res_activiteit_omschrijving,
|
||||
rsa.res_srtactiviteit_omschrijving,
|
||||
voorz.catalogus,
|
||||
voorz.product,
|
||||
''
|
||||
FROM res_v_aanwezigrsv_ruimte rrr,
|
||||
res_activiteit ra,
|
||||
res_srtactiviteit rsa,
|
||||
res_reservering res,
|
||||
prs_perslid p,
|
||||
prs_afdeling a,
|
||||
(SELECT rrd.res_rsv_ruimte_key
|
||||
res_rsv_ruimte_key,
|
||||
-rd.res_deel_key
|
||||
product_key,
|
||||
rd.res_deel_omschrijving
|
||||
product,
|
||||
DECODE (
|
||||
rd.res_deel_prijs_vast,
|
||||
1, NVL (rrd.res_rsv_deel_prijs, rd.res_deel_prijs),
|
||||
(rrd.res_rsv_deel_tot - rrd.res_rsv_deel_van)
|
||||
* 24
|
||||
* NVL (rrd.res_rsv_deel_prijs, rd.res_deel_prijs))
|
||||
totaalprijs,
|
||||
rrd.res_rsv_deel_van
|
||||
van,
|
||||
rrd.res_rsv_deel_tot
|
||||
tot,
|
||||
(rrd.res_rsv_deel_tot - rrd.res_rsv_deel_van) * 24
|
||||
aantal,
|
||||
NVL (rrd.res_rsv_deel_prijs, rd.res_deel_prijs)
|
||||
prijs,
|
||||
c.ins_discipline_key
|
||||
ins_discipline_key,
|
||||
c.ins_discipline_omschrijving
|
||||
catalogus,
|
||||
'object'
|
||||
vtype
|
||||
FROM res_v_aanwezigrsv_deel rrd,
|
||||
res_deel rd,
|
||||
ins_deel d,
|
||||
ins_tab_discipline c
|
||||
WHERE rrd.res_deel_key = rd.res_deel_key
|
||||
AND d.ins_deel_key = rd.res_ins_deel_key
|
||||
AND rrd.res_rsv_ruimte_key IS NOT NULL
|
||||
AND c.ins_discipline_key = rd.res_discipline_key
|
||||
) voorz
|
||||
WHERE rrr.res_reservering_key = res.res_reservering_key
|
||||
AND rrr.res_rsv_ruimte_key = voorz.res_rsv_ruimte_key
|
||||
AND rrr.res_activiteit_key = ra.res_activiteit_key
|
||||
AND ra.res_srtactiviteit_key = rsa.res_srtactiviteit_key
|
||||
AND rrr.res_rsv_ruimte_host_key = p.prs_perslid_key
|
||||
AND p.prs_afdeling_key = a.prs_afdeling_key
|
||||
AND rsa.res_srtactiviteit_key = 2
|
||||
AND rrr.res_rsv_ruimte_van >= TO_DATE ('01-01-2010', 'DD-MM-YYYY');
|
||||
|
||||
------ 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
|
||||
Reference in New Issue
Block a user