First Commit - Source Code from Reply
This commit is contained in:
53
dbcmnpsrc/FE/mnpapp/script/dbUpDate/KitLuglio13/dwhDML.sql
Normal file
53
dbcmnpsrc/FE/mnpapp/script/dbUpDate/KitLuglio13/dwhDML.sql
Normal file
@@ -0,0 +1,53 @@
|
||||
INSERT INTO dwh.MNP_DW_REPORT_CAPACITAEVASIONE
|
||||
(MESE, GIORNI_LAVORATIVI, RICHIESTE_PRESEINCARICO, RICHIESTE_SCARTATE_WAITLIST, RICHIESTE_SCARTATE_MANPROGR)
|
||||
VALUES(
|
||||
TO_CHAR(Last_Day(ADD_MONTHS(sysdate,-2))+1,'MM/YYYY'),
|
||||
dwh.FUN_GIORNI_LAVORATIVI(Last_Day(ADD_MONTHS(sysdate,-1)), Last_Day(ADD_MONTHS(sysdate,-2))+1),
|
||||
( select count(*)
|
||||
from mnp_storico_richiesta t, mnp_gestione_richiesta r
|
||||
where t.id_richiesta = r.id_richiesta
|
||||
and (r.richiestaadhocaom = 0 and r.richiestaadhoc = 0)
|
||||
and t.dataricezionerichiesta between Last_Day(ADD_MONTHS(sysdate,-2))+1 AND Last_Day(ADD_MONTHS(sysdate,-1))
|
||||
and r.dataricezionerichiesta between Last_Day(ADD_MONTHS(sysdate,-2))+1 AND Last_Day(ADD_MONTHS(sysdate,-1))
|
||||
and t.stato_a = 3),
|
||||
( select count(*)
|
||||
from mnp_gestione_richiesta t
|
||||
where t.dataricezionerichiesta between Last_Day(ADD_MONTHS(sysdate,-2))+1 AND Last_Day(ADD_MONTHS(sysdate,-1))
|
||||
and t.stato = 4
|
||||
and (t.richiestaadhocaom = 0 and t.richiestaadhoc = 0)
|
||||
and t.codice_controllo_validazione = 7),
|
||||
( select count(*)
|
||||
from mnp_gestione_richiesta t
|
||||
where t.dataricezionerichiesta between Last_Day(ADD_MONTHS(sysdate,-2))+1 AND Last_Day(ADD_MONTHS(sysdate,-1))
|
||||
and t.stato = 4
|
||||
and t.codice_controllo_validazione = 3)
|
||||
);
|
||||
|
||||
INSERT INTO dwh.MNP_DW_REPORT_CAPACITAEVASIONE
|
||||
(MESE, GIORNI_LAVORATIVI, RICHIESTE_PRESEINCARICO, RICHIESTE_SCARTATE_WAITLIST, RICHIESTE_SCARTATE_MANPROGR)
|
||||
VALUES(
|
||||
TO_CHAR(Last_Day(ADD_MONTHS(sysdate,-3))+1,'MM/YYYY'),
|
||||
dwh.FUN_GIORNI_LAVORATIVI(Last_Day(ADD_MONTHS(sysdate,-1)), Last_Day(ADD_MONTHS(sysdate,-2))+1),
|
||||
( select count(*)
|
||||
from mnp_storico_richiesta t, mnp_gestione_richiesta r
|
||||
where t.id_richiesta = r.id_richiesta
|
||||
and (r.richiestaadhocaom = 0 and r.richiestaadhoc = 0)
|
||||
and t.dataricezionerichiesta between Last_Day(ADD_MONTHS(sysdate,-2))+1 AND Last_Day(ADD_MONTHS(sysdate,-1))
|
||||
and r.dataricezionerichiesta between Last_Day(ADD_MONTHS(sysdate,-2))+1 AND Last_Day(ADD_MONTHS(sysdate,-1))
|
||||
and t.stato_a = 3),
|
||||
( select count(*)
|
||||
from mnp_gestione_richiesta t
|
||||
where t.dataricezionerichiesta between Last_Day(ADD_MONTHS(sysdate,-2))+1 AND Last_Day(ADD_MONTHS(sysdate,-1))
|
||||
and t.stato = 4
|
||||
and (t.richiestaadhocaom = 0 and t.richiestaadhoc = 0)
|
||||
and t.codice_controllo_validazione = 7),
|
||||
( select count(*)
|
||||
from mnp_gestione_richiesta t
|
||||
where t.dataricezionerichiesta between Last_Day(ADD_MONTHS(sysdate,-2))+1 AND Last_Day(ADD_MONTHS(sysdate,-1))
|
||||
and t.stato = 4
|
||||
and t.codice_controllo_validazione = 3)
|
||||
);
|
||||
|
||||
|
||||
|
||||
commit;
|
||||
Reference in New Issue
Block a user