First Commit - Source Code from Reply
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
-- DBC_1 Numero Notifiche di PRESAINCARICO A SYSDATE-1
|
||||
-- il tipo prestazione è sempre NP
|
||||
select count(*) as NUM_PRESAINCARICO_OK from HZ_PITAGORA_IN
|
||||
where TIPO_NOTIFICA = 0 AND STATO_ORDINE = 0 and DATA_INSERIMENTO = trunc(sysdate-1);
|
||||
@@ -0,0 +1,4 @@
|
||||
-- DBC_2 Numero Notifiche di Presa In Carico KO A SYSDATE-1
|
||||
-- il tipo prestazione è sempre NP
|
||||
select count(*) as NUM_PRESAINCARICO_KO from HZ_PITAGORA_IN
|
||||
where TIPO_NOTIFICA = 0 AND STATO_ORDINE = 1 and DATA_INSERIMENTO = trunc(sysdate-1);
|
||||
@@ -0,0 +1,7 @@
|
||||
-- DBC_3_DeltaT Tempo Medio da ACQUISITA in PRESAINCARICO a SYSDATE-1
|
||||
select AVG(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) as MEDIA_ACQUISITA_PRESAINCARICO
|
||||
from HZ_STORICO_RICHIESTA a, HZ_STORICO_RICHIESTA b
|
||||
where a.stato_da=1
|
||||
and b.stato_a=3
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.data_lavorazione = trunc(sysdate-1);
|
||||
@@ -0,0 +1,7 @@
|
||||
-- DBC_4_DeltaT Tempo Medio da INVIATA a PRESAINCARICO a SYSDATE-1
|
||||
select AVG(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) as MEDIA_INVIATA_PRESAINCARICO
|
||||
from HZ_STORICO_RICHIESTA a, HZ_STORICO_RICHIESTA b
|
||||
where a.stato_da=2
|
||||
and b.stato_a=3
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.data_lavorazione = trunc(sysdate-1);
|
||||
@@ -0,0 +1,3 @@
|
||||
-- DBC_5 Numero Notifiche di ACCETTAZIONE OK a SYSDATE-1
|
||||
select count(*) as NUM_ACCETTATA from HZ_PITAGORA_IN
|
||||
where TIPO_NOTIFICA = 1 AND STATO_ORDINE = 2 and DATA_INSERIMENTO = trunc(sysdate-1);
|
||||
@@ -0,0 +1,7 @@
|
||||
-- DBC_6_DeltaT - Tempo Medio da INVIATA ad ACCETTATA a SYSDATE-1
|
||||
select AVG(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) as MEDIA_INVIATA_ACCETTATA
|
||||
from HZ_STORICO_RICHIESTA a, HZ_STORICO_RICHIESTA b
|
||||
where a.stato_da=2
|
||||
and b.stato_a=5
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.data_lavorazione = trunc(sysdate-1);
|
||||
@@ -0,0 +1,3 @@
|
||||
-- DBC_7 - Numero Notifiche ESPLETATA A SYSDATE-1
|
||||
select count(*) as NUM_ESPLETATA from HZ_PITAGORA_IN
|
||||
where TIPO_NOTIFICA = 2 AND STATO_ORDINE = 3 and DATA_INSERIMENTO = trunc(sysdate-1);
|
||||
@@ -0,0 +1,3 @@
|
||||
-- DBC_8 - Numero Notifiche ESPLETATA KO a SYSDATE-1
|
||||
select count(*) as NUM_ESPLETATA_KO from HZ_PITAGORA_IN
|
||||
where TIPO_NOTIFICA = 2 AND STATO_ORDINE = 4 and DATA_INSERIMENTO = trunc(sysdate-1);
|
||||
@@ -0,0 +1,7 @@
|
||||
-- DBC_9_DeltaT - Tempo Medio da INVIATA a ESPLETAMENTO
|
||||
select AVG(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) as MEDIA_INVIATA_ESPLETAMENTO
|
||||
from HZ_STORICO_RICHIESTA a, HZ_STORICO_RICHIESTA b
|
||||
where a.stato_da=2
|
||||
and b.stato_a=7
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.data_lavorazione = trunc(sysdate-1);
|
||||
@@ -0,0 +1,101 @@
|
||||
-Indicatori Donor
|
||||
21:00;SDNRPIC01;
|
||||
21:00;SDNRPIC01A;
|
||||
21:00;SDNRPIC24;
|
||||
21:00;SDNRPIC25;
|
||||
21:00;SDNRPIC26;
|
||||
21:00;SDNRPIC27;
|
||||
22:00;SDNRPIC28;
|
||||
22:00;SDNRPIC29;
|
||||
21:00;SDNRVAL01;
|
||||
21:00;SDNRVAL01A;
|
||||
21:00;SDNRVAL42;
|
||||
21:00;SDNRVAL42A;
|
||||
21:00;SDNRVAL43;
|
||||
21:00;SDNRVAL43A;
|
||||
21:00;SDNRANN01;
|
||||
21:00;SDNRAN01A;
|
||||
21:00;SDNRVAL69;
|
||||
21:00;SDNRVAL70;
|
||||
21:00;SDNRVAL27;mnp_xml_in12
|
||||
21:00;SDNRESP30;mnp_xml_in12
|
||||
23:45;SDNRESP01B;
|
||||
23:45;SDNRVAL331;
|
||||
23:45;SDNRESP57;
|
||||
23:45;SDNRESP57A;
|
||||
23:45;SDNRESP59;
|
||||
23:45;SDNRESP59A;
|
||||
23:45;SSCRMSS01;
|
||||
--Indicatori Recipient, Terze Parti, Cessazione Definitive
|
||||
21:00;SRCORIC06
|
||||
21:00;SRCOACQ02
|
||||
22:00;SRBURIC06
|
||||
21:00;SRBUACQ02
|
||||
21:00;SRCOPIC99
|
||||
21:00;SRBUPIC99
|
||||
21:00;SRCOVAL02
|
||||
21:00;SRBUVAL02
|
||||
23:45;SRCOATT01
|
||||
23:45;SRBUATT01
|
||||
22:00;SRCOPIC13
|
||||
22:00;SRCOPIC23
|
||||
22:00;SRCOVAL11
|
||||
22:00;SRCOVAL16
|
||||
22:00;SRCOVAL41
|
||||
22:00;SRCOATT17
|
||||
22:00;SRBUPIC12
|
||||
22:00;SRBUPIC13
|
||||
22:00;SRBUVAL11
|
||||
22:00;SRBUVAL16
|
||||
22:00;SRBUATT17
|
||||
21:00;SNTFYPT05
|
||||
22:00;SNTFYPT13
|
||||
23:45;SNTFYPT26
|
||||
23:45;SNTFYPT34
|
||||
21:00;SNTYCES05
|
||||
21:00;SNTYCES07
|
||||
22:00;SNTYCES08
|
||||
23:45;SDNRVAL95
|
||||
23:45;SDNRVAL95A
|
||||
23:45;SDNRESP72
|
||||
23:45;SDNRVAL68
|
||||
22:00;SNTYCES25
|
||||
22:00;SCESDEF16
|
||||
-- Indicatori ricezione XML
|
||||
05:10;SXMLIN001;mnp_xml_in12
|
||||
06:10;SXMLIN002;mnp_xml_in12
|
||||
07:10;SXMLIN003;mnp_xml_in12
|
||||
08:10;SXMLIN004;mnp_xml_in12
|
||||
09:10;SXMLIN005;mnp_xml_in12
|
||||
10:10;SXMLIN006;mnp_xml_in12
|
||||
11:10;SXMLIN007;mnp_xml_in12
|
||||
12:10;SXMLIN008;mnp_xml_in12
|
||||
13:10;SXMLIN009;mnp_xml_in12
|
||||
14:10;SXMLIN010;mnp_xml_in12
|
||||
15:10;SXMLIN011;mnp_xml_in12
|
||||
16:10;SXMLIN012;mnp_xml_in12
|
||||
17:10;SXMLIN013;mnp_xml_in12
|
||||
18:10;SXMLIN014;mnp_xml_in12
|
||||
19:10;SXMLIN015;mnp_xml_in12
|
||||
-- Indicatori invio XML
|
||||
05:10;SXMLOU001;mnp_xml_out12
|
||||
06:10;SXMLOU002;mnp_xml_out12
|
||||
07:10;SXMLOU003;mnp_xml_out12
|
||||
08:10;SXMLOU004;mnp_xml_out12
|
||||
09:10;SXMLOU005;mnp_xml_out12
|
||||
10:10;SXMLOU006;mnp_xml_out12
|
||||
11:10;SXMLOU007;mnp_xml_out12
|
||||
12:10;SXMLOU008;mnp_xml_out12
|
||||
13:10;SXMLOU009;mnp_xml_out12
|
||||
14:10;SXMLOU010;mnp_xml_out12
|
||||
15:10;SXMLOU011;mnp_xml_out12
|
||||
16:10;SXMLOU012;mnp_xml_out12
|
||||
17:10;SXMLOU013;mnp_xml_out12
|
||||
18:10;SXMLOU014;mnp_xml_out12
|
||||
19:10;SXMLOU015;mnp_xml_out12
|
||||
-- Indicatore invio ACK
|
||||
09:10;SACKOU001;mnp_xml_out12
|
||||
13:10;SACKOU001;mnp_xml_out12
|
||||
18:10;SACKOU001;mnp_xml_out12
|
||||
-- Indicatori ricezione file da sistemi
|
||||
18:00;ADBCFIN01
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/ksh
|
||||
|
||||
oggi=`date +%Y%m%d`
|
||||
|
||||
cp IndicatoriMNP.properties IndicatoriMNP.properties.old$oggi
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo 'Attenzione: impossibile aggiornare il file delle properties'
|
||||
rm IndicatoriMNP.properties.old$oggi 2> /dev/null
|
||||
else
|
||||
rm IndicatoriMNP.properties
|
||||
cp IndicatoriMNP$oggi.properties IndicatoriMNP.properties
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
rm IndicatoriMNP$oggi.properties
|
||||
else
|
||||
echo 'Attenzione impossibile sostituire il file di properties'
|
||||
fi
|
||||
fi
|
||||
|
||||
114
dbcmnpsrc/FE/mnpapp/script/governance/monitoring.sh
Normal file
114
dbcmnpsrc/FE/mnpapp/script/governance/monitoring.sh
Normal file
@@ -0,0 +1,114 @@
|
||||
#!/usr/bin/ksh
|
||||
#set -x
|
||||
###########################################################
|
||||
# Progetto: Gateway MNP
|
||||
###########################################################
|
||||
|
||||
THIS_PATH=`dirname $0`
|
||||
. $THIS_PATH/../setEnv.sh
|
||||
|
||||
$THIS_PATH/../TestNodo.sh
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
# ESECUZIONE SCRIPT
|
||||
|
||||
if [[ "$#" -eq 2 ]]
|
||||
then
|
||||
#passaggio parametro del grado di parallelismo
|
||||
PARA=$2
|
||||
FREQ=$1
|
||||
elif [[ "$#" -eq 1 ]]
|
||||
then
|
||||
#per default viene posto il grado di parallelismo a 20
|
||||
PARA=20
|
||||
FREQ=$1
|
||||
else
|
||||
echo 'usage:monitoring.sh "frequenza(formato hh24:mi)" [ grado di parallelismo (formato 999) ]'
|
||||
exit
|
||||
fi
|
||||
|
||||
#controllo del formato dei parametri
|
||||
if ! echo $PARA | grep ^[0-9]$ > /dev/null 2>/dev/null
|
||||
then if ! echo $PARA | grep ^[0-9][0-9]$ > /dev/null 2>/dev/null
|
||||
then if ! echo $PARA | grep ^[0-9][0-9][0-9]$ > /dev/null 2>/dev/null
|
||||
then
|
||||
echo 'usage:monitoring.sh frequenza [grado di parallelismo]'
|
||||
echo 'formato frequenza:'
|
||||
echo ' - hh24:mi'
|
||||
echo ' - 00:45_23:45'
|
||||
echo ' - 10:15_19:15'
|
||||
echo 'formato grado di parallelismo (opzionale per default è 20):'
|
||||
echo ' - numero intero da 0 a 999'
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! echo $FREQ | grep ^[0-1][0-9]:[0-5][0-9]$ > /dev/null 2>/dev/null
|
||||
then
|
||||
if ! echo $FREQ | grep ^[2][0-3]:[0-5][0-9]$ > /dev/null 2>/dev/null
|
||||
then
|
||||
if ! echo $FREQ | grep ^[0-1][0-9]:[0-5][0-9]_[0-1][0-9]:[0-5][0-9]$ > /dev/null 2>/dev/null
|
||||
then
|
||||
if ! echo $FREQ | grep ^[0-1][0-9]:[0-5][0-9]_[2][0-3]:[0-5][0-9]$ > /dev/null 2>/dev/null
|
||||
then
|
||||
echo 'usage:monitoring.sh frequenza [grado di parallelismo]'
|
||||
echo 'formato frequenza:'
|
||||
echo ' - hh24:mi'
|
||||
echo ' - 00:45_23:45'
|
||||
echo ' - 10:15_19:15'
|
||||
echo 'formato grado di parallelismo (opzionale per default è 20):'
|
||||
echo ' - numero intero da 0 a 999'
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
PATH_INDICATORI="PATH_INDICATORI"
|
||||
export PATH_INDICATORI
|
||||
|
||||
HOSTARIA=`uname -n`
|
||||
|
||||
nome_file="${MNP_SCRIPT_GOV_INPUT_HOME}/IndicatoriMNP.properties"
|
||||
|
||||
LISTA=`grep "$FREQ;" $nome_file | grep -v '-' | more`
|
||||
|
||||
i=1
|
||||
indicatori_elab=''
|
||||
PARA=`expr $PARA - 1`
|
||||
|
||||
for linea in $LISTA
|
||||
do
|
||||
|
||||
indicatore=`echo $linea | cut -f2 -d';'`
|
||||
partizione=`echo $linea | cut -f3 -d';'`
|
||||
|
||||
adesso=$(date)
|
||||
|
||||
if [ $i -le $PARA ]
|
||||
then
|
||||
echo '******' $adesso Indicatore $indicatore
|
||||
echo exit|$MNP_SCRIPT_HOME/sqlExecutor.sh -sqlplus ${MNP_SCRIPT_GOV_SQL_HOME}/$indicatore.sql $FREQ $partizione $PATH_INDICATORI $HOSTARIA> ${MNP_LOG_SCRIPT_GOV_HOME}/$indicatore.log 2>&1 &
|
||||
indicatori_elab=$indicatori_elab' '$indicatore
|
||||
i=`expr $i + 1`
|
||||
else
|
||||
echo '******' $adesso Indicatore $indicatore
|
||||
echo exit|$MNP_SCRIPT_HOME/sqlExecutor.sh -sqlplus ${MNP_SCRIPT_GOV_SQL_HOME}/$indicatore.sql $FREQ $partizione $PATH_INDICATORI $HOSTARIA> ${MNP_LOG_SCRIPT_GOV_HOME}/$indicatore.log 2>&1 &
|
||||
indicatori_elab=$indicatori_elab' '$indicatore
|
||||
wait
|
||||
echo '------------------- Indicatori elaborati : '$indicatori_elab
|
||||
i=1
|
||||
indicatori_elab=''
|
||||
fi
|
||||
done
|
||||
if [ $i -ne 1 ]
|
||||
then
|
||||
echo '------------------- Indicatori elaborati : '$indicatori_elab
|
||||
fi
|
||||
else
|
||||
echo 'SCRIPT NON ESEGUITO'
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,12 @@
|
||||
/*Numero totale di richieste Donor MVNO in ritardo di validazione*/
|
||||
SELECT COUNT (*), gr.operatore_interno AS operatore_donor,
|
||||
gr.codice_operatore_recipient AS operatore_recipient
|
||||
FROM mnp_gestione_richiesta gr, mnp_operatore_interno oi
|
||||
WHERE gr.operatore_interno(+) = oi.nome_operatore
|
||||
AND oi.tipologia_operatore = 'MVNO'
|
||||
AND gr.tipo_cliente = 'CO'
|
||||
AND gr.stato IN (1, 3, 6)
|
||||
AND gr.data_validazione_max < TRUNC (SYSDATE)
|
||||
AND gr.data_validazione_eff IS NULL
|
||||
GROUP BY gr.operatore_interno, gr.codice_operatore_recipient;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/* Numero totale di richieste Donor MVNO in ritardo di espletamento */
|
||||
SELECT COUNT (*), gr.operatore_interno AS operatore_donor,
|
||||
gr.codice_operatore_recipient AS operatore_recipient
|
||||
FROM mnp_gestione_richiesta gr, mnp_operatore_interno oi
|
||||
WHERE gr.operatore_interno(+) = oi.nome_operatore
|
||||
AND oi.tipologia_operatore = 'MVNO'
|
||||
AND gr.tipo_cliente = 'CO'
|
||||
AND gr.stato IN (7, 9, 14, 15)
|
||||
AND gr.data_cut_over_calc < TRUNC (SYSDATE)
|
||||
GROUP BY gr.operatore_interno, gr.codice_operatore_recipient;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*Numero totale di richieste Donor Virtuale in ritardo di validazione*/
|
||||
SELECT COUNT (*), gr.codice_operatore_donating AS operatore_donor,
|
||||
gr.operatore_interno_recipient AS operatore_recipient
|
||||
FROM mnp_gest_rich_donor_virt gr, mnp_operatore_interno oi
|
||||
WHERE gr.operatore_interno_recipient(+) = oi.nome_operatore
|
||||
AND oi.tipologia_operatore IN ('PROVIDER', 'ESP')
|
||||
AND gr.stato IN (1, 2, 3, 4, 5)
|
||||
AND gr.data_validazione_max < TRUNC (SYSDATE)
|
||||
AND gr.data_validazione_eff IS NULL
|
||||
GROUP BY gr.operatore_interno_recipient, gr.codice_operatore_donating;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/* Numero totale di richieste Donor Virtuale in ritardo di espletamento */
|
||||
SELECT COUNT (*), gr.codice_operatore_donating AS operatore_donor,
|
||||
gr.operatore_interno_recipient AS operatore_recipient
|
||||
FROM mnp_gest_rich_donor_virt gr, mnp_operatore_interno oi
|
||||
WHERE gr.operatore_interno_recipient(+) = oi.nome_operatore
|
||||
AND oi.tipologia_operatore IN ('PROVIDER', 'ESP')
|
||||
AND gr.stato IN (6, 8, 10)
|
||||
AND gr.data_cut_over_calc < TRUNC (SYSDATE)
|
||||
GROUP BY gr.operatore_interno_recipient, gr.codice_operatore_donating;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/* Numero Totale di Richieste Recipient MVNO in ritardo di Validazione */
|
||||
SELECT COUNT (*), gr.codice_operatore_donating AS operatore_donor,
|
||||
gr.operatore_interno AS operatore_recipient
|
||||
FROM mnp_gestione_richiesta_rec gr, mnp_operatore_interno oi
|
||||
WHERE gr.operatore_interno(+) = oi.nome_operatore
|
||||
AND oi.tipologia_operatore = 'MVNO'
|
||||
AND gr.stato IN (2, 3, 4, 6)
|
||||
AND gr.data_validazione_max < TRUNC (SYSDATE)
|
||||
AND gr.data_validazione_eff IS NULL
|
||||
GROUP BY gr.operatore_interno, gr.codice_operatore_donating;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/* Numero totale di richieste Recipient MVNO in ritardo di espletamento */
|
||||
SELECT COUNT (*), gr.codice_operatore_donating AS operatore_donor,
|
||||
gr.operatore_interno AS operatore_recipient
|
||||
FROM mnp_gestione_richiesta_rec gr, mnp_operatore_interno oi
|
||||
WHERE gr.operatore_interno(+) = oi.nome_operatore
|
||||
AND oi.tipologia_operatore = 'MVNO'
|
||||
AND gr.stato IN (8, 10, 11)
|
||||
AND gr.data_cut_over_aom < TRUNC (SYSDATE)
|
||||
GROUP BY gr.operatore_interno, gr.codice_operatore_donating;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*Numero totale di richieste Recipient Virtuale MVNO in ritardo di validazione*/
|
||||
SELECT COUNT (*), gr.codice_operatore_recipient AS operatore_recipient,
|
||||
gr.operatore_interno_donating AS operatore_donating
|
||||
FROM mnp_gest_rich_rec_virt gr, mnp_operatore_interno oi
|
||||
WHERE gr.operatore_interno_donating(+) = oi.nome_operatore
|
||||
AND oi.tipologia_operatore IN ('ESP', 'PROVIDER')
|
||||
AND gr.stato IN (1, 2, 3, 4, 5)
|
||||
AND gr.data_validazione_max < TRUNC (SYSDATE)
|
||||
AND gr.data_validazione_eff IS NULL
|
||||
GROUP BY gr.codice_operatore_recipient, gr.operatore_interno_donating;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/* Numero Totale di Richieste Recipient Virtuale in ritardo di espletamento */
|
||||
SELECT COUNT (*), gr.codice_operatore_recipient AS operatore_recipient,
|
||||
gr.operatore_interno_donating AS operatore_donating
|
||||
FROM mnp_gest_rich_rec_virt gr, mnp_operatore_interno oi
|
||||
WHERE gr.operatore_interno_donating(+) = oi.nome_operatore
|
||||
AND oi.tipologia_operatore IN ('ESP', 'PROVIDER')
|
||||
AND gr.stato IN (6, 8, 10, 11)
|
||||
AND gr.data_cut_over_calc < TRUNC (SYSDATE)
|
||||
GROUP BY gr.codice_operatore_recipient, gr.operatore_interno_donating;
|
||||
|
||||
106
dbcmnpsrc/FE/mnpapp/script/governance/sql/ADBCFIN01.sql
Normal file
106
dbcmnpsrc/FE/mnpapp/script/governance/sql/ADBCFIN01.sql
Normal file
@@ -0,0 +1,106 @@
|
||||
-- [ ADBCFIN01 ]
|
||||
--Esito Acquisizione flussi dai Sistemi Esterni
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select attr,val,free||decode(n,0,null,1,null,' ('||n||' volte)') as free,data_val
|
||||
from(
|
||||
select attr,val,free,max(data_val) as data_val,count(*) as n
|
||||
from (
|
||||
select decode(e.id_flusso, -- file con nome corretto caricati completamente o in parte o non caricati
|
||||
10,'Validazione CO',
|
||||
11,'Validazione CO',
|
||||
16,'Validazione BU')||'-:-'||
|
||||
decode(e.id_flusso,
|
||||
10,'CCRM',
|
||||
11,'CCRM',
|
||||
16,'BIT')||'-:-'||
|
||||
a.descrizione as attr,
|
||||
b.tipo_evento as val,
|
||||
c.descrizione as free,
|
||||
sysdate as data_val
|
||||
from mnp_evento_governance a, mnp_processo_log b, mnp_anagrafica_log c, mnp_anagrafica_processo d, mnp_flussi_sistemi_interni e
|
||||
where a.codice_processo=b.codice_processo
|
||||
and a.codice_log=b.codice_log
|
||||
and a.codice_log=c.codice_log
|
||||
and a.codice_processo=d.codice_processo
|
||||
and substr(a.descrizione,1,length(e.PREFISSO)) = e.PREFISSO
|
||||
--and e.id_flusso in (10,11,16) elimino CU
|
||||
and e.id_flusso in (10,16)
|
||||
and a.data_evento between trunc(sysdate) and trunc (sysdate+1)
|
||||
UNION ALL
|
||||
select 'Non Definito'||'-:-'|| -- file con nome NON corretto quindi non caricati
|
||||
'Non Definito'||'-:-'||
|
||||
a.descrizione as attr,
|
||||
b.tipo_evento as val,
|
||||
c.descrizione as free,
|
||||
sysdate as data_val
|
||||
from mnp_evento_governance a, mnp_processo_log b, mnp_anagrafica_log c, mnp_anagrafica_processo d
|
||||
where a.codice_processo=b.codice_processo
|
||||
and a.codice_log=b.codice_log
|
||||
and a.codice_log=c.codice_log
|
||||
and a.codice_processo=d.codice_processo
|
||||
and a.data_evento between trunc(sysdate) and trunc (sysdate+1)
|
||||
and not exists (
|
||||
select 1
|
||||
from mnp_flussi_sistemi_interni e
|
||||
where substr(a.descrizione,1,length(e.PREFISSO)) = e.PREFISSO
|
||||
--and e.id_flusso in (10,11,16) elimino CU
|
||||
and e.id_flusso in (10,16)
|
||||
)
|
||||
UNION ALL
|
||||
select decode(e.id_flusso,
|
||||
10,'Validazione CO',
|
||||
11,'Validazione CO',
|
||||
16,'Validazione BU')||'-:-'||
|
||||
decode(e.id_flusso,
|
||||
10,'CCRM',
|
||||
11,'CCRM',
|
||||
16,'BIT')||'-:-'||
|
||||
e.prefisso as attr,
|
||||
b.tipo_evento as val,
|
||||
c.descrizione as free,
|
||||
sysdate as data_val
|
||||
from mnp_processo_log b, mnp_anagrafica_log c, mnp_anagrafica_processo d, mnp_flussi_sistemi_interni e
|
||||
where b.codice_log=c.codice_log
|
||||
and b.codice_processo=d.codice_processo
|
||||
and b.codice_log='7308'
|
||||
--and e.id_flusso in (10,11,16) elimino CU
|
||||
and e.id_flusso in (10,16)
|
||||
and not exists(
|
||||
select 1
|
||||
from mnp_evento_governance a
|
||||
where substr(a.descrizione,1,length(e.PREFISSO)) = e.PREFISSO
|
||||
and a.data_evento between trunc(sysdate) and trunc (sysdate+1))
|
||||
)
|
||||
group by attr,val,free
|
||||
);
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for rec_valore in cur_valore loop
|
||||
|
||||
UTL_FILE.put_line(file1,'ADBCFIN01'||';'||rec_valore.attr||';'||rec_valore.val||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(rec_valore.data_val,'yyyymmdd')||';'||to_char(rec_valore.data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'||'0'||';'||rec_valore.attr||';'||rec_valore.free||';');
|
||||
|
||||
end loop;
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
75
dbcmnpsrc/FE/mnpapp/script/governance/sql/SACKOU001.sql
Normal file
75
dbcmnpsrc/FE/mnpapp/script/governance/sql/SACKOU001.sql
Normal file
@@ -0,0 +1,75 @@
|
||||
/* Formatted on 2006/01/12 18:11 (Formatter Plus v4.8.0) */
|
||||
--L’indicatore deve riportare il numero totale di file ACK del giorno ancora non inviati da TIM verso AOM
|
||||
--(senza alcuna aggregazione).
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
valore VARCHAR2 (255);
|
||||
data_val DATE;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq VARCHAR2 (255) := '&1';
|
||||
|
||||
CURSOR cur_valore
|
||||
IS
|
||||
SELECT COUNT (nome_file), SYSDATE
|
||||
FROM mnp_xml_out PARTITION (&2)
|
||||
WHERE tipo_file = 8
|
||||
AND TRUNC (data_eff) = TRUNC (SYSDATE)
|
||||
AND data_invio IS NULL;
|
||||
BEGIN
|
||||
DBMS_OUTPUT.put_line ( 'apro il file '
|
||||
|| 'MNP'
|
||||
|| '.'
|
||||
|| TO_CHAR (SYSDATE, 'yyyyMMdd')
|
||||
);
|
||||
file1 :=
|
||||
UTL_FILE.fopen ('&3', 'MNP' || '.' || TO_CHAR (SYSDATE, 'yyyyMMdd'),
|
||||
'a');
|
||||
|
||||
OPEN cur_valore;
|
||||
|
||||
LOOP
|
||||
FETCH cur_valore
|
||||
INTO valore, data_val;
|
||||
|
||||
EXIT WHEN cur_valore%NOTFOUND;
|
||||
UTL_FILE.put_line (file1,
|
||||
'SACKOU001'
|
||||
|| ';;'
|
||||
|| valore
|
||||
|| ';'
|
||||
|| freq
|
||||
|| ';'
|
||||
|| '&4'
|
||||
|| ';'
|
||||
|| TO_CHAR (data_val, 'yyyymmdd')
|
||||
|| ';'
|
||||
|| TO_CHAR (data_val, 'hh24:mi:ss')
|
||||
|| ';'
|
||||
|| TO_CHAR (SYSDATE, 'yyyymmdd')
|
||||
|| ';'
|
||||
|| TO_CHAR (SYSDATE, 'hh24:mi:ss')
|
||||
|| ';'
|
||||
|| '0'
|
||||
|| ';;;'
|
||||
);
|
||||
END LOOP;
|
||||
CLOSE cur_valore;
|
||||
|
||||
|
||||
UTL_FILE.fflush (file1);
|
||||
UTL_FILE.fclose (file1);
|
||||
DBMS_OUTPUT.put_line ( 'chiudo il file '
|
||||
|| 'MNP'
|
||||
|| '.'
|
||||
|| TO_CHAR (SYSDATE, 'yyyyMMdd')
|
||||
);
|
||||
EXCEPTION
|
||||
WHEN OTHERS
|
||||
THEN
|
||||
DBMS_OUTPUT.put_line (SQLERRM);
|
||||
END;
|
||||
/
|
||||
|
||||
EXIT
|
||||
70
dbcmnpsrc/FE/mnpapp/script/governance/sql/SANNMLT01.sql
Normal file
70
dbcmnpsrc/FE/mnpapp/script/governance/sql/SANNMLT01.sql
Normal file
@@ -0,0 +1,70 @@
|
||||
-- [ SANNMLT01 ]
|
||||
--L'indicatore riporta il numero totale di richieste annullamento multiplo Recipient
|
||||
--di tipo Business che giornalmente sono state acquisite su DBC.
|
||||
--I dati sono aggregati per:
|
||||
--Operatore Donating e Tipo Contratto.
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quante sono le possibili
|
||||
--combinazioni dell'aggregazione: Operatore Donating-Tipo Contratto.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_contratto varchar2(3);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*),sysdate
|
||||
from mnp_gestione_richiesta_rec a, mnp_storico_richiesta_rec b
|
||||
where a.id_richiesta = b.id_richiesta
|
||||
and a.stato=2
|
||||
and b.data_lavorazione = trunc(sysdate)-1/86400
|
||||
and b.stato_a = 2
|
||||
and a.codice_operatore_donating = operatore
|
||||
and a.tipo_cliente = 'BU'
|
||||
and a.codice_pre_post_pagato = var_tipo_contratto;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%notfound;
|
||||
|
||||
-- tipo contratto di tipo POP(Postpagato) e PRP(Prepagato)
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_contratto:='POP';
|
||||
else var_tipo_contratto:='PRP';
|
||||
end if;
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
|
||||
UTL_FILE.put_line(file1,'SANNMLT01'||';'||operatore||'-:-'||var_tipo_contratto||';'||valore||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||'-:-'||var_tipo_contratto||';;');
|
||||
close cur_valore;
|
||||
end loop; -- fine for
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
45
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF01.sql
Normal file
45
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF01.sql
Normal file
@@ -0,0 +1,45 @@
|
||||
-- [ SCESDEF01 ]
|
||||
--L'indicatore riporta il numero totale di Cessazioni Definitive ricevute
|
||||
--giornalmente su DBC dal sistema MSS di rete.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
|
||||
|
||||
select count(*), sysdate into valore, data_val
|
||||
from MNP_MSS_CESS_PORTING_IN
|
||||
where trunc(data_ricezione) = trunc(sysdate);
|
||||
|
||||
|
||||
UTL_FILE.put_line(file1,'SCESDEF01'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
|
||||
|
||||
48
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF07.sql
Normal file
48
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF07.sql
Normal file
@@ -0,0 +1,48 @@
|
||||
-- [ SCESDEF07 ]
|
||||
--L'indicatore riporta il numero totale di Cessazioni Definitive pervenute
|
||||
--da MSS e poste giornalmente nello stato "Acquisita" su DBC.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
|
||||
|
||||
select count(*), sysdate into valore, data_val
|
||||
from mnp_storico_cess_porting
|
||||
where stato_a = 1
|
||||
and data_lavorazione > trunc(sysdate)-1/86400
|
||||
and data_lavorazione < trunc(sysdate+1);
|
||||
|
||||
|
||||
UTL_FILE.put_line(file1,'SCESDEF07'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
|
||||
|
||||
49
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF08.sql
Normal file
49
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF08.sql
Normal file
@@ -0,0 +1,49 @@
|
||||
-- [ SCESDEF08 ]
|
||||
--L'indicatore riporta il numero totale di Cessazioni Definitive pervenute
|
||||
--da MSS e poste giornalmente nello stato "Cessata" su DBC.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
|
||||
|
||||
select count(*), sysdate into valore, data_val
|
||||
from mnp_storico_cess_porting
|
||||
where stato_a = 2
|
||||
and data_lavorazione > trunc(sysdate)-1/86400
|
||||
and data_lavorazione < trunc(sysdate+1);
|
||||
|
||||
|
||||
UTL_FILE.put_line(file1,'SCESDEF08'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
89
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF09.sql
Normal file
89
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF09.sql
Normal file
@@ -0,0 +1,89 @@
|
||||
-- [ SCESDEF09 ]
|
||||
--L'indicatore riporta giornalmente il tempo medio impiegato per il passaggio di stato
|
||||
--da "Acquisita" a "Cessata" delle Cessazioni Definitive.
|
||||
--Il dato viene calcolato giornalmente per le richieste che nella giornata di rilevazione
|
||||
--risultano passate nello stato cessata.
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono
|
||||
--passate in tale stato il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
|
||||
set serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
data_acq date;
|
||||
data_prc date;
|
||||
giorni_diff number(10) :=0;
|
||||
i number(10) :=0;
|
||||
media varchar2(10):=0;
|
||||
somma number(10) :=0;
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
|
||||
cursor cur_date is
|
||||
select trunc(a.data_lavorazione),trunc(b.data_lavorazione)
|
||||
from mnp_storico_cess_porting a, mnp_storico_cess_porting b
|
||||
where a.stato_a=1
|
||||
and b.stato_a=2
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta;
|
||||
|
||||
|
||||
BEGIN
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
|
||||
--calcolo la media
|
||||
open cur_date;
|
||||
i:=0;
|
||||
media:='-';
|
||||
somma:=0;
|
||||
data_val:=sysdate;
|
||||
loop
|
||||
|
||||
fetch cur_date into data_acq, data_prc;
|
||||
exit when cur_date%notfound;
|
||||
|
||||
select count(*)-1 into giorni_diff
|
||||
from s_dim_tempo a
|
||||
where a.data between data_acq and data_prc
|
||||
and a.tip_gio not in ('P','F');
|
||||
|
||||
somma:= somma + giorni_diff;
|
||||
i:=i+1;
|
||||
|
||||
end loop;
|
||||
close cur_date;
|
||||
|
||||
if(i!=0) then
|
||||
media:=to_char(round(somma/i,2));
|
||||
if((somma/i>0) and (somma/i < 1))
|
||||
then
|
||||
media:= '0'|| media;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
UTL_FILE.put_line(file1,'SCESDEF09'||';;'||media||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
83
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF10.sql
Normal file
83
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF10.sql
Normal file
@@ -0,0 +1,83 @@
|
||||
-- [ SCESDEF10 ]
|
||||
--L'indicatore riporta giornalmente il tempo massimo impiegato per il passaggio di stato
|
||||
--da "Acquisita" a "Cessata" delle Cessazioni Definitive.
|
||||
--Il dato viene calcolato giornalmente per le richieste che nella giornata di rilevazione
|
||||
--risultano passate nello stato cessata.
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono
|
||||
--passate in tale stato il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
set serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, b.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_cess_porting a, mnp_storico_cess_porting b, s_dim_tempo d
|
||||
where a.stato_a=1
|
||||
and b.stato_a=2
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by b.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_cess_porting a
|
||||
where a.stato_a = 2
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1);
|
||||
|
||||
id_rich_max:=trunc(rich_prc*100/100);
|
||||
rich_prc:=0;
|
||||
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SCESDEF10'||';;'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SCESDEF10'||';;'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
47
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF13.sql
Normal file
47
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF13.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
-- [ SCESDEF13 ]
|
||||
--L'indicatore riporta il numero totale di cessazioni annullate nel giorno.
|
||||
--Il record deve essere prodotto anche nel caso il valore rilevato sia "zero".
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
|
||||
|
||||
select count(*), sysdate into valore, data_val
|
||||
from mnp_storico_cess_porting
|
||||
where stato_a = 5
|
||||
and data_lavorazione > trunc(sysdate)-1/86400
|
||||
and data_lavorazione < trunc(sysdate+1);
|
||||
|
||||
|
||||
UTL_FILE.put_line(file1,'SCESDEF13'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
|
||||
|
||||
84
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF14.sql
Normal file
84
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF14.sql
Normal file
@@ -0,0 +1,84 @@
|
||||
-- [ SCESDEF14 ]
|
||||
--L'indicatore riporta giornalmente il tempo massimo impiegato per il passaggio di stato
|
||||
--da "Acquisita" a "Cessata" per il 95% delle Cessazioni Definitive.
|
||||
--Il dato viene calcolato giornalmente per le richieste che nella giornata di rilevazione
|
||||
--risultano passate nello stato cessata.
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono
|
||||
--passate in tale stato il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
|
||||
set serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, b.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_cess_porting a, mnp_storico_cess_porting b, s_dim_tempo d
|
||||
where a.stato_a=1
|
||||
and b.stato_a=2
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by b.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_cess_porting a
|
||||
where a.stato_a = 2
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1);
|
||||
|
||||
id_rich_max:=round((rich_prc*95)/100);
|
||||
rich_prc:=0;
|
||||
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SCESDEF14'||';;'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SCESDEF14'||';;'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
47
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF15.sql
Normal file
47
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF15.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
-- [ SCESDEF15 ]
|
||||
--L'indicatore riporta riportare il numero totale di notifiche di
|
||||
--cessazioni definitive da TIM prodotte per CIRCE nella giornata.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
|
||||
select count(*), sysdate into valore, data_val
|
||||
from mnp_circe_out_cess_port
|
||||
where stato = '72'
|
||||
and trunc(data_creazione) = trunc(sysdate)
|
||||
and da_inviare = 0;
|
||||
|
||||
|
||||
UTL_FILE.put_line(file1,'SCESDEF15'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
46
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF16.sql
Normal file
46
dbcmnpsrc/FE/mnpapp/script/governance/sql/SCESDEF16.sql
Normal file
@@ -0,0 +1,46 @@
|
||||
-- [ SCESDEF16 ]
|
||||
--L'indicatore riporta il numero totale di notifiche di cessazioni definitive
|
||||
--da TIM da produrre nel giorno per CIRCE e ancora non prodotte.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
|
||||
select count(*), sysdate into valore, data_val
|
||||
from mnp_circe_out_cess_port
|
||||
where stato = '72'
|
||||
and trunc(data_creazione) = trunc(sysdate)
|
||||
and da_inviare = 1;
|
||||
|
||||
|
||||
UTL_FILE.put_line(file1,'SCESDEF16'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
68
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ01.sql
Normal file
68
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ01.sql
Normal file
@@ -0,0 +1,68 @@
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR
|
||||
--poste giornalmente nello stato "Acquisita" su DBC.
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno
|
||||
--il totale per quante sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente-OLO Recipient (ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato
|
||||
--sia "zero".
|
||||
|
||||
--oss:
|
||||
--?Non sempre risulta possibile raggruppare le richiesta acquisite
|
||||
--per tipologia cliente perché il campo non è valorizzato al momento dell'acquisizione.
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*),sysdate
|
||||
from mnp_gestione_richiesta a, mnp_storico_richiesta b
|
||||
where a.id_richiesta =b.id_richiesta
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and b.stato_a =1
|
||||
and a.codice_operatore_recipient=operatore
|
||||
and a.tipo_cliente=var_tipo_cliente;
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%notfound;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRACQ01'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
72
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ03.sql
Normal file
72
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ03.sql
Normal file
@@ -0,0 +1,72 @@
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR
|
||||
--poste giornalmente nello stato "Annullata" su DBC e per cui
|
||||
--il passaggio a tale stato sia avvenuto prima della Presa in Carico .
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il
|
||||
--totale per quante sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente-OLO Recipient (ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*),sysdate
|
||||
from mnp_gestione_richiesta a,mnp_storico_richiesta b
|
||||
where a.id_richiesta =b.id_richiesta
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and b.stato_a =12
|
||||
and tipo_cliente = var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore
|
||||
and not exists
|
||||
(select id_richiesta
|
||||
from mnp_storico_richiesta
|
||||
where stato_a=3);
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ03'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
36
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ05.sql
Normal file
36
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ05.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
--L'indicatore riporta il numero totale di flussi (file) XML pervenuti giornalmente
|
||||
--dagli OLO a DBC e scartati per 'duplicazione'.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_scarto a
|
||||
where a.cod_scarto=1
|
||||
and a.data_eff>trunc(sysdate)-1/86400
|
||||
and a.data_eff<trunc(sysdate+1);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ05'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ06.sql
Normal file
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ06.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
--L'indicatore riporta il numero totale di flussi (file) XML pervenuti giornalmente
|
||||
--dagli OLO a DBC e scartati per 'xml non valido'.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_scarto
|
||||
where cod_scarto=0
|
||||
and data_eff>trunc(sysdate)-1/86400
|
||||
and data_eff<trunc(sysdate+1);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ06'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
63
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ08.sql
Normal file
63
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ08.sql
Normal file
@@ -0,0 +1,63 @@
|
||||
--L'indicatore riporta il numero totale di acknowledge XML di
|
||||
--acquisizione richieste inviate agli OLO con esito OK.
|
||||
--I dati sono aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quanti
|
||||
--sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
operatore varchar2(4);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo
|
||||
from mnp_olo a
|
||||
where a.flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_out a
|
||||
where a.mittente=operatore
|
||||
and a.tipo_file='8'
|
||||
and a.da_inviare=0
|
||||
and a.nome_file = (select b.nome_file
|
||||
from mnp_xml_ack_out b
|
||||
where b.nome_file = a.nome_file
|
||||
and b.risultato='OK'
|
||||
and b.nome_file_riferito = ( select c.nome_file
|
||||
from mnp_xml_in c
|
||||
where c.tipo_file = '1'
|
||||
and c.nome_file = b.nome_file_riferito
|
||||
)
|
||||
);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ08'||';'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
63
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ09.sql
Normal file
63
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ09.sql
Normal file
@@ -0,0 +1,63 @@
|
||||
--L'indicatore riporta giornalmente il numero totale di acknowledge XML
|
||||
--di acquisizione richieste inviate agli OLO con esito KO. I dati sono aggregati per:
|
||||
--OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quanti sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
operatore varchar2(4);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo
|
||||
from mnp_olo a
|
||||
where a.flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_out a
|
||||
where a.mittente=operatore
|
||||
and a.tipo_file='8'
|
||||
and a.data_ultimo_invio>trunc(sysdate)-1/86400
|
||||
and a.data_ultimo_invio<trunc(sysdate+1)
|
||||
and a.da_inviare=0
|
||||
and a.nome_file = (select b.nome_file
|
||||
from mnp_xml_ack_out b
|
||||
where b.nome_file = a.nome_file
|
||||
and b.risultato='ERROR'
|
||||
and b.nome_file_riferito = ( select c.nome_file
|
||||
from mnp_xml_in c
|
||||
where c.tipo_file = '1'
|
||||
and c.nome_file = b.nome_file_riferito
|
||||
)
|
||||
);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ09'||';'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ51.sql
Normal file
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ51.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
--L'indicatore riporta il numero totale di flussi (file) XML pervenuti giornalmente dagli OLO
|
||||
--a DBC e scartati per 'parametri non corrispondenti'.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_scarto a
|
||||
where a.cod_scarto=3
|
||||
and a.data_eff>trunc(sysdate)-1/86400
|
||||
and a.data_eff<trunc(sysdate+1);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ51'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
36
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ61.sql
Normal file
36
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ61.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
--L'indicatore riporta il numero totale di flussi (file) XML di Acknowledge
|
||||
--pervenuti giornalmente dagli OLO a DBC e scartati per 'mancata associazione'.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_scarto a
|
||||
where a.cod_scarto=2
|
||||
and a.tipo_file=8
|
||||
and trunc(a.data_eff)=trunc(sysdate);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ61'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
38
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ62.sql
Normal file
38
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ62.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
--L'indicatore riporta il numero totale di flussi (file) XML di Acknowledge
|
||||
--pervenuti giornalmente dagli OLO a DBC e scartati perche' non attesi.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_scarto
|
||||
where cod_scarto=4
|
||||
and tipo_file=8
|
||||
and data_eff>trunc(sysdate)-1/86400
|
||||
and data_eff<trunc(sysdate+1);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ62'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ63.sql
Normal file
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ63.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
--L'indicatore riporta il numero totale di flussi (file) XML pervenuti giornalmente
|
||||
-- dagli OLO a DBC e scartati per 'codice operatore donating non corrispondente'.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_scarto
|
||||
where cod_scarto=5
|
||||
and data_eff>trunc(sysdate)-1/86400
|
||||
and data_eff<trunc(sysdate+1);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ63'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ64.sql
Normal file
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ64.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
--L'indicatore riporta il numero totale di flussi (file) XML pervenuti giornalmente
|
||||
--dagli OLO a DBC e scartati per 'codice operatore non corrispondente'.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_scarto
|
||||
where cod_scarto=6
|
||||
and data_eff>trunc(sysdate)-1/86400
|
||||
and data_eff<trunc(sysdate+1);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ64'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ65.sql
Normal file
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ65.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
--L'indicatore riporta il numero totale di flussi (file) XML pervenuti giornalmente
|
||||
--dagli OLO a DBC e scartati per 'codice operatore donating non ammesso'.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_scarto
|
||||
where cod_scarto='7'
|
||||
and data_eff>trunc(sysdate)-1/86400
|
||||
and data_eff<trunc(sysdate+1);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ65'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ66.sql
Normal file
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRACQ66.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
--L'indicatore riporta il numero totale di flussi (file) XML pervenuti giornalmente
|
||||
--dagli OLO a DBC e scartati per 'richiesta/operatore recipient non corrispondenti''.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_scarto
|
||||
where cod_scarto=9
|
||||
and data_eff>trunc(sysdate)-1/86400
|
||||
and data_eff<trunc(sysdate+1);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRACQ66'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
39
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRAN01A.sql
Normal file
39
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRAN01A.sql
Normal file
@@ -0,0 +1,39 @@
|
||||
--L'indicatore deve riportare il numero totale di richieste MNP DONOR annullate
|
||||
--per duplicazione da inviare al sistema BIT (in pending sul sistema DBC).
|
||||
--Il record deve essere prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_bit_annull_out a, mnp_gestione_richiesta b
|
||||
where a.id_richiesta = b.id_richiesta
|
||||
and b.codicerifiutovalidazione in (11,12)
|
||||
and a.da_inviare=1;
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRAN01A'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRANN01.sql
Normal file
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRANN01.sql
Normal file
@@ -0,0 +1,41 @@
|
||||
--L'indicatore deve riportare il numero totale di richieste MNP DONOR annullate
|
||||
--per duplicazione inviate al sistema BIT.
|
||||
--Il record deve essere prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_bit_annull_out a, mnp_gestione_richiesta b
|
||||
where a.id_richiesta=b.id_richiesta
|
||||
and b.codicerifiutovalidazione in (11,12)
|
||||
and a.da_inviare=0
|
||||
and a.data_invio>trunc(sysdate)-1/86400
|
||||
and a.data_invio<trunc(sysdate+1);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRANN01'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
70
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRANN03.sql
Normal file
70
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRANN03.sql
Normal file
@@ -0,0 +1,70 @@
|
||||
-- [ SDNRANN03 ]
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR poste
|
||||
--giornalmente nello stato "Bloccata" su DBC.
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente e per OLO Recipient.
|
||||
--Sono prodotti tanti record riportanti ognuno
|
||||
--il totale per quante sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente e per OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(3);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
|
||||
for i in 0..1
|
||||
loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
|
||||
select count(*), sysdate into valore, data_val
|
||||
from mnp_gestione_richiesta a, mnp_storico_richiesta b
|
||||
where b.stato_a = 22
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.tipo_cliente= var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRANN03'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
|
||||
end loop; -- fine for
|
||||
|
||||
end loop; --fine operatore
|
||||
close cur_operatore;
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
|
||||
end;
|
||||
/
|
||||
exit
|
||||
63
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP01B.sql
Normal file
63
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP01B.sql
Normal file
@@ -0,0 +1,63 @@
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR validate positivamente
|
||||
--(stato ACCETTATA) ma ancora non cessate (con data cut-over prevista nel giorno o nei giorni precedenti).
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quante sono
|
||||
--le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente-OLO Recipient (ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta
|
||||
where stato=9
|
||||
and data_cut_over_calc <= trunc(sysdate+1)-1/86400
|
||||
and tipo_cliente=var_tipo_cliente
|
||||
and codice_operatore_recipient=operatore;
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP01B'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
|
||||
61
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP02B.sql
Normal file
61
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP02B.sql
Normal file
@@ -0,0 +1,61 @@
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR
|
||||
--in cessazione (stato IN CESSAZIONE)
|
||||
--ma ancora non cessate (con data cut-over prevista nel giorno o nei giorni precedenti).
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale
|
||||
--per quante sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente-OLO Recipient (ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a
|
||||
where a.stato=14
|
||||
and trunc(a.data_cut_over_calc) <= trunc(sysdate)
|
||||
and a.tipo_cliente=var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore;
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&3','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP02B'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';'||''||';');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
67
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP03A.sql
Normal file
67
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP03A.sql
Normal file
@@ -0,0 +1,67 @@
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR
|
||||
--cessate sulla rete Tim ma ancora non espletate
|
||||
--(notifica di espletamento non inviata al Recipient
|
||||
--o ack sul messaggio di espletamento non ricevuto).
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quante
|
||||
--sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente-OLO Recipient (ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a
|
||||
where a.stato=15
|
||||
and a.tipo_cliente=var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore
|
||||
and not exists (select c.id_richiesta
|
||||
from mnp_xml_richiesta_out c,mnp_xml_out d
|
||||
where c.nome_file=d.nome_file
|
||||
and d.tipo_file='6'
|
||||
and d.da_inviare=0
|
||||
and d.numero_invii>=1
|
||||
AND d.destinatario!='NPTS');
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP03A'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
64
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP04.sql
Normal file
64
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP04.sql
Normal file
@@ -0,0 +1,64 @@
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR
|
||||
--poste in stato espletata nel giorno.
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per
|
||||
--quante sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente-OLO Recipient (ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a, mnp_storico_richiesta b
|
||||
where a.id_richiesta = b.id_richiesta
|
||||
and b.stato_a=16
|
||||
--and trunc(b.data_lavorazione)=trunc(sysdate)
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.tipo_cliente=var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore;
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP04'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
63
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP05.sql
Normal file
63
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP05.sql
Normal file
@@ -0,0 +1,63 @@
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR
|
||||
--poste in stato 'in cessazione' nel giorno.
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per
|
||||
--quante sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente-OLO Recipient (ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a, mnp_storico_richiesta b
|
||||
where a.id_richiesta = b.id_richiesta
|
||||
and b.stato_a=14
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.tipo_cliente=var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore;
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP05'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
62
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP06.sql
Normal file
62
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP06.sql
Normal file
@@ -0,0 +1,62 @@
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR
|
||||
--poste in stato 'cessata' nel giorno.
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale
|
||||
--per quante sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente-OLO Recipient (ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a, mnp_storico_richiesta b
|
||||
where a.id_richiesta = b.id_richiesta
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.tipo_cliente=var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore;
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP06'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP08.sql
Normal file
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP08.sql
Normal file
@@ -0,0 +1,93 @@
|
||||
--L'indicatore riporta giornalmente il tempo medio impiegato per il passaggio di stato da "Accettata"
|
||||
-- a "in cessazione".
|
||||
--Il tempo medio calcolato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU). Sono prodotti tanti record riportanti
|
||||
--ognuno il tempo medio calcolato per ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata di
|
||||
--rilevazione hanno subito un passaggio nello stato di "in cessazione".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate
|
||||
--nello stato "in cessazione" il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
data_acq date;
|
||||
data_prc date;
|
||||
giorni_diff number(10):=0;
|
||||
i number(10):=0;
|
||||
media varchar2(10):=0;
|
||||
somma number(10):=0;
|
||||
var_tipo_cliente varchar2(2);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_date is
|
||||
select trunc(a.data_lavorazione),trunc(b.data_lavorazione)
|
||||
from mnp_storico_richiesta a, mnp_storico_richiesta b, mnp_gestione_richiesta c
|
||||
where a.stato_a=9
|
||||
and b.stato_a=14
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
cursor cur_giorni_diff is
|
||||
select count(*)-1
|
||||
from s_dim_tempo a
|
||||
where a.data between data_acq and data_prc
|
||||
and a.tip_gio not in ('P','F');
|
||||
|
||||
BEGIN
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
--calcolo la media
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
|
||||
open cur_date;
|
||||
i:=0;
|
||||
media:='-';
|
||||
somma:=0;
|
||||
loop
|
||||
data_val:=sysdate;
|
||||
|
||||
fetch cur_date into data_acq, data_prc;
|
||||
exit when cur_date%notfound;
|
||||
|
||||
open cur_giorni_diff;
|
||||
fetch cur_giorni_diff into giorni_diff;
|
||||
|
||||
somma:= somma + giorni_diff;
|
||||
i:=i+1;
|
||||
|
||||
|
||||
close cur_giorni_diff;
|
||||
end loop;
|
||||
close cur_date;
|
||||
if(i!=0) then
|
||||
media:=to_char(round(somma/i,2));
|
||||
end if;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP08'||';'||var_tipo_cliente||';'||media||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
91
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP09.sql
Normal file
91
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP09.sql
Normal file
@@ -0,0 +1,91 @@
|
||||
--L'indicatore riporta giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"Accettata" a "in cessazione".
|
||||
--Il tempo massimo rilevato è suddiviso per: Tipologia Cliente (CO/BU).
|
||||
--Sono prodotti tanti record riportanti ognuno il tempo massimo rilevato per
|
||||
--ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata di rilevazione
|
||||
--hanno subito un passaggio nello stato di "in cessazione".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate
|
||||
--nello stato "in cessazione" il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=9
|
||||
and b.stato_a=14
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=14
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
id_rich_max:=trunc(rich_prc/100*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
DBMS_OUTPUT.put_line('SDNRESP09'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP09'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
97
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP10.sql
Normal file
97
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP10.sql
Normal file
@@ -0,0 +1,97 @@
|
||||
--L'indicatore riporta giornalmente il tempo medio impiegato per il passaggio di stato da "Accettata"
|
||||
--a "cessata" (cessazione su rete Tim).
|
||||
--il tempo medio calcolato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU).
|
||||
--Sono prodotti tanti record riportanti ognuno il tempo medio calcolato
|
||||
--per ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata
|
||||
--di rilevazione hanno subito un passaggio nello stato di "cessata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello
|
||||
--stato "cessata" il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso
|
||||
--associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
data_acq date;
|
||||
data_prc date;
|
||||
giorni_diff number(10):=0;
|
||||
i number(10):=0;
|
||||
media varchar2(10):=0;
|
||||
somma number(10):=0;
|
||||
var_tipo_cliente varchar2(2);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_date is
|
||||
select trunc(a.data_lavorazione),trunc(b.data_lavorazione)
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c
|
||||
where a.stato_a=9
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
cursor cur_giorni_diff is
|
||||
select count(*)-1
|
||||
from s_dim_tempo a
|
||||
where a.data between data_acq and data_prc
|
||||
and a.tip_gio not in ('P','F');
|
||||
|
||||
BEGIN
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
--calcolo la media
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
|
||||
open cur_date;
|
||||
i:=0;
|
||||
media:='-';
|
||||
somma:=0;
|
||||
loop
|
||||
data_val:=sysdate;
|
||||
|
||||
fetch cur_date into data_acq, data_prc;
|
||||
exit when cur_date%notfound;
|
||||
|
||||
open cur_giorni_diff;
|
||||
fetch cur_giorni_diff into giorni_diff;
|
||||
|
||||
somma:= somma + giorni_diff;
|
||||
i:=i+1;
|
||||
|
||||
|
||||
close cur_giorni_diff;
|
||||
end loop;
|
||||
close cur_date;
|
||||
if(i!=0) then
|
||||
media:=to_char(round(somma/i,2));
|
||||
end if;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP10'||';'||var_tipo_cliente||';'||media||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP11.sql
Normal file
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP11.sql
Normal file
@@ -0,0 +1,93 @@
|
||||
--L'indicatore riporta giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"Accettata" a "cessata".
|
||||
--Il tempo massimo rilevato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU).
|
||||
--Sono prodotti tanti record riportanti ognuno il tempo massimo rilevato per ognuna
|
||||
--delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata di
|
||||
--rilevazione hanno subito un passaggio nello stato di "cessata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "cessata"
|
||||
--il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato devono essere presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=9
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=15
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
id_rich_max:=trunc(rich_prc/100*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP11'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP11'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP14.sql
Normal file
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP14.sql
Normal file
@@ -0,0 +1,93 @@
|
||||
--L'indicatore riporta giornalmente il tempo medio impiegato per il passaggio di stato da "in cessazione"
|
||||
--a "cessata" (su rete Tim).
|
||||
--Il tempo medio calcolato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU). Sono prodotti tanti record riportanti ognuno
|
||||
--il tempo medio calcolato per ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata di
|
||||
--rilevazione hanno subito un passaggio nello stato di "cessata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono
|
||||
--transitate nello stato "cessata" il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
data_acq date;
|
||||
data_prc date;
|
||||
giorni_diff number(10):=0;
|
||||
i number(10):=0;
|
||||
media varchar2(10):=0;
|
||||
somma number(10):=0;
|
||||
var_tipo_cliente varchar2(2);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_date is
|
||||
select trunc(a.data_lavorazione),trunc(b.data_lavorazione)
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c
|
||||
where a.stato_a=14
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
cursor cur_giorni_diff is
|
||||
select count(*)-1
|
||||
from s_dim_tempo a
|
||||
where a.data between data_acq and data_prc
|
||||
and a.tip_gio not in ('P','F');
|
||||
|
||||
BEGIN
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
--calcolo la media
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
|
||||
open cur_date;
|
||||
i:=0;
|
||||
media:='-';
|
||||
somma:=0;
|
||||
loop
|
||||
data_val:=sysdate;
|
||||
|
||||
fetch cur_date into data_acq, data_prc;
|
||||
exit when cur_date%notfound;
|
||||
|
||||
open cur_giorni_diff;
|
||||
fetch cur_giorni_diff into giorni_diff;
|
||||
|
||||
somma:= somma + giorni_diff;
|
||||
i:=i+1;
|
||||
|
||||
|
||||
close cur_giorni_diff;
|
||||
end loop;
|
||||
close cur_date;
|
||||
if(i!=0) then
|
||||
media:=to_char(round(somma/i,2));
|
||||
end if;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP14'||';'||var_tipo_cliente||';'||media||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
94
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP15.sql
Normal file
94
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP15.sql
Normal file
@@ -0,0 +1,94 @@
|
||||
--L'indicatore riporta giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"in cessazione" a "cessata" (su rete Tim).
|
||||
--Il tempo massimo rilevato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU).
|
||||
--Sono prodotti tanti record riportanti ognuno il tempo massimo rilevato
|
||||
--per ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata di rilevazione
|
||||
--hanno subito un passaggio nello stato di "cessata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "cessata"
|
||||
--il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=14
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=15
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
id_rich_max:=trunc(rich_prc/100*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP15'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP15'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
95
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP18.sql
Normal file
95
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP18.sql
Normal file
@@ -0,0 +1,95 @@
|
||||
--L'indicatore riporta giornalmente il tempo medio impiegato per il passaggio di stato da "cessata"
|
||||
--a "espletata".
|
||||
--Il tempo medio calcolato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU). Sono prodotti tanti record riportanti ognuno
|
||||
--il tempo medio calcolato per ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata
|
||||
--di rilevazione hanno subito un passaggio nello stato di "espletata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "espletata"
|
||||
--il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
data_acq date;
|
||||
data_prc date;
|
||||
giorni_diff number(10):=0;
|
||||
i number(10):=0;
|
||||
media varchar2(10):=0;
|
||||
somma number(10):=0;
|
||||
var_tipo_cliente varchar2(2);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_date is
|
||||
select trunc(a.data_lavorazione),trunc(b.data_lavorazione)
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c
|
||||
where a.stato_a=15
|
||||
and b.stato_a=16
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
cursor cur_giorni_diff is
|
||||
select count(*)-1
|
||||
from s_dim_tempo a
|
||||
where a.data between data_acq and data_prc
|
||||
and a.tip_gio not in ('P','F');
|
||||
|
||||
BEGIN
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
--calcolo la media
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
|
||||
open cur_date;
|
||||
i:=0;
|
||||
media:='-';
|
||||
somma:=0;
|
||||
loop
|
||||
data_val:=sysdate;
|
||||
|
||||
fetch cur_date into data_acq, data_prc;
|
||||
exit when cur_date%notfound;
|
||||
|
||||
open cur_giorni_diff;
|
||||
fetch cur_giorni_diff into giorni_diff;
|
||||
|
||||
somma:= somma + giorni_diff;
|
||||
i:=i+1;
|
||||
|
||||
|
||||
close cur_giorni_diff;
|
||||
end loop;
|
||||
close cur_date;
|
||||
if(i!=0) then
|
||||
media:=to_char(round(somma/i,2));
|
||||
end if;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP18'||';'||var_tipo_cliente||';'||media||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
92
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP19.sql
Normal file
92
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP19.sql
Normal file
@@ -0,0 +1,92 @@
|
||||
--L'indicatore riporta giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"cessata" a "espletata".
|
||||
--Il tempo massimo rilevato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU).
|
||||
--Sono prodotti tanti record riportanti ognuno il tempo massimo rilevato
|
||||
--per ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata
|
||||
--di rilevazione hanno subito un passaggio nello stato di "espletata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono
|
||||
--transitate nello stato "espletata" il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=15
|
||||
and b.stato_a=16
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=16
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
id_rich_max:=trunc(rich_prc/100*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP19'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP19'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
96
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP22.sql
Normal file
96
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP22.sql
Normal file
@@ -0,0 +1,96 @@
|
||||
--L'indicatore riporta giornalmente il tempo medio impiegato per il passaggio di stato da "acquisita"
|
||||
--a "cessata" (cessata su rete Tim).
|
||||
--Il tempo medio calcolato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU). Sono prodotti tanti record riportanti ognuno
|
||||
--il tempo medio calcolato per ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata
|
||||
--di rilevazione hanno subito un passaggio nello stato di "cessata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono
|
||||
--transitate nello stato "cessata" il dato non viene rilevato.
|
||||
--Il record però è essere prodotto anche in questo caso associando
|
||||
--all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
data_acq date;
|
||||
data_prc date;
|
||||
giorni_diff number(10):=0;
|
||||
i number(10):=0;
|
||||
media varchar2(10):=0;
|
||||
somma number(10):=0;
|
||||
var_tipo_cliente varchar2(2);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_date is
|
||||
select trunc(a.data_lavorazione),trunc(b.data_lavorazione)
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c
|
||||
where a.stato_a=1
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
cursor cur_giorni_diff is
|
||||
select count(*)-1
|
||||
from s_dim_tempo a
|
||||
where a.data between data_acq and data_prc
|
||||
and a.tip_gio not in ('P','F');
|
||||
|
||||
BEGIN
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
--calcolo la media
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
|
||||
open cur_date;
|
||||
i:=0;
|
||||
media:='-';
|
||||
somma:=0;
|
||||
loop
|
||||
data_val:=sysdate;
|
||||
|
||||
fetch cur_date into data_acq, data_prc;
|
||||
exit when cur_date%notfound;
|
||||
|
||||
open cur_giorni_diff;
|
||||
fetch cur_giorni_diff into giorni_diff;
|
||||
|
||||
somma:= somma + giorni_diff;
|
||||
i:=i+1;
|
||||
|
||||
|
||||
close cur_giorni_diff;
|
||||
end loop;
|
||||
close cur_date;
|
||||
if(i!=0) then
|
||||
media:=to_char(round(somma/i,2));
|
||||
end if;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP22'||';'||var_tipo_cliente||';'||media||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
94
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP23.sql
Normal file
94
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP23.sql
Normal file
@@ -0,0 +1,94 @@
|
||||
--L'indicatore riporta giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"acquisita" a "cessata".
|
||||
--Il tempo massimo rilevato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU).
|
||||
--Sono prodotti tanti record riportanti ognuno il tempo massimo rilevato
|
||||
--per ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata di
|
||||
--rilevazione hanno subito un passaggio nello stato di "cessata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "cessata"
|
||||
--il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=1
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=15
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
id_rich_max:=trunc(rich_prc/100*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
DBMS_OUTPUT.put_line('SDNRESP23'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||'A valle delle operazioni di transizione di stato in "cessata"'||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP23'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
60
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP28.sql
Normal file
60
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP28.sql
Normal file
@@ -0,0 +1,60 @@
|
||||
--L'indicatore riporta giornalmente il numero totale di notifiche di espletamento
|
||||
-- - per il processo DONOR - inviati da DBC all'OLO Recipient.
|
||||
--I dati sono aggregati per:
|
||||
--OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quanti
|
||||
--sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_richiesta_out a, mnp_xml_out b
|
||||
where a.nome_file = b.nome_file
|
||||
and b.tipo_file='6'
|
||||
and b.tipo_processo='D'
|
||||
and b.da_inviare=0
|
||||
and b.data_ultimo_invio>trunc(sysdate)-1/86400
|
||||
and b.data_ultimo_invio<trunc(sysdate+1)
|
||||
and b.destinatario=operatore;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP28'||';'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
62
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP29.sql
Normal file
62
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP29.sql
Normal file
@@ -0,0 +1,62 @@
|
||||
--L'indicatore riporta il numero totale di ACK OK ricevuti in giornata dall'OLO Recipient
|
||||
--relativi alle notifiche di espletamento inviate da DBC.
|
||||
--I dati sono aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quanti sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
operatore varchar2(4);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo
|
||||
from mnp_olo a
|
||||
where a.flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_in partition(&2) a
|
||||
where a.destinatario=operatore
|
||||
and a.tipo_file='8'
|
||||
and a.data_eff>trunc(sysdate)-1/86400
|
||||
and a.data_eff<trunc(sysdate+1)
|
||||
and a.nome_file = (select b.nome_file
|
||||
from mnp_xml_ack_in b
|
||||
where b.nome_file = a.nome_file
|
||||
and b.risultato='OK'
|
||||
and b.nome_file_riferito = ( select c.nome_file
|
||||
from mnp_xml_out c
|
||||
where c.tipo_file = '6'
|
||||
and c.da_inviare=0
|
||||
and c.nome_file = b.nome_file_riferito
|
||||
)
|
||||
);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&3','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP29'||';'||operatore||';'||valore||';'||freq||';'||'&4'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
64
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP30.sql
Normal file
64
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP30.sql
Normal file
@@ -0,0 +1,64 @@
|
||||
--L'indicatore riporta il numero totale di ACK KO ricevuti in giornata dall'OLO Recipient
|
||||
--relativi alle notifiche di espletamento inviate da DBC.
|
||||
--I dati sono aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quanti sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
operatore varchar2(4);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo
|
||||
from mnp_olo a
|
||||
where a.flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_xml_in partition(&2) a
|
||||
where a.destinatario=operatore
|
||||
and a.tipo_file='8'
|
||||
and a.data_eff>trunc(sysdate)-1/86400
|
||||
and a.data_eff<trunc(sysdate+1)
|
||||
and a.nome_file = (select b.nome_file
|
||||
from mnp_xml_ack_in b
|
||||
where b.nome_file = a.nome_file
|
||||
and b.risultato='ERROR'
|
||||
and b.nome_file_riferito = ( select c.nome_file
|
||||
from mnp_xml_out c
|
||||
where c.tipo_file = '6'
|
||||
and c.da_inviare=0
|
||||
and c.nome_file = b.nome_file_riferito
|
||||
)
|
||||
);
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&3','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP30'||';'||operatore||';'||valore||';'||freq||';'||'&4'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP35.sql
Normal file
37
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP35.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
--L'indicatore riporta il numero totale di esiti Cessazione ricevuti giornalmente da MSS.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
Select count(*), sysdate
|
||||
from mnp_mss_cessazione_in
|
||||
where data_ricezione > trunc(sysdate)-1/86400
|
||||
and data_ricezione < trunc(sysdate+1);
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP35'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP38.sql
Normal file
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP38.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Consumer Abbonamento
|
||||
--in validazione ancora da cessare con data cut-over non trascorsa.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a
|
||||
where a.tipo_cliente='CO'
|
||||
and a.abbonato_prepagato='ABBONATO'
|
||||
and a.stato=6
|
||||
and a.data_cut_over_calc>=sysdate;
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP38'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||valore||';;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP39.sql
Normal file
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP39.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Business Abbonamento
|
||||
--in validazione ancora da cessare con data cut-over non trascorsa.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a
|
||||
where a.tipo_cliente='BU'
|
||||
and a.abbonato_prepagato='ABBONATO'
|
||||
and a.stato=6
|
||||
and a.data_cut_over_calc>=trunc(sysdate+1)-1/86400;
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP39'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP40.sql
Normal file
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP40.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Consumer Abbonamento
|
||||
--in validazione e ancora da cessare con data cut-over trascorsa.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta
|
||||
where tipo_cliente='CO'
|
||||
and abbonato_prepagato='ABBONATO'
|
||||
and stato=6
|
||||
and data_cut_over_calc<sysdate;
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP40'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP41.sql
Normal file
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP41.sql
Normal file
@@ -0,0 +1,41 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Business Abbonamento
|
||||
--in validazione e ancora da cessare con data cut-over trascorsa.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta
|
||||
where tipo_cliente='BU'
|
||||
and abbonato_prepagato='ABBONATO'
|
||||
and stato=6
|
||||
and data_cut_over_calc<sysdate;
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP41'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP42.sql
Normal file
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP42.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Consumer cessate
|
||||
--in anticipo rispetto la data di cut over prevista.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a, mnp_storico_richiesta b
|
||||
where a.tipo_cliente='CO'
|
||||
and a.data_cut_over_calc>sysdate
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.stato_a=15;
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP42'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP43.sql
Normal file
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP43.sql
Normal file
@@ -0,0 +1,41 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Business cessate
|
||||
--in anticipo rispetto la data di cut over prevista.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a, mnp_storico_richiesta b
|
||||
where a.tipo_cliente='BU'
|
||||
and a.data_cut_over_calc>sysdate
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.stato_a=15;
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP43'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
38
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP45.sql
Normal file
38
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP45.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
--L'indicatore deve riportare il numero totale di notifiche di cessazione ancora non inviate a CRM-B.
|
||||
-- I dati non devono essere aggregati per alcun attributo.
|
||||
--Il record deve essere prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
Select count(*)
|
||||
FROM MNP_ASP_CRM_CESSAZIONE_OUT
|
||||
WHERE MNP_ASP_CRM_CESSAZIONE_OUT.data_invio is null
|
||||
AND trunc(MNP_ASP_CRM_CESSAZIONE_OUT.data_creazione) < trunc(sysdate)
|
||||
AND trunc(MNP_ASP_CRM_CESSAZIONE_OUT.data_creazione) > '5 ottobre 2003'
|
||||
AND substr(MNP_ASP_CRM_CESSAZIONE_OUT.nome_file,1,19) = 'MNP_CRMBCESS_DONOR_';
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&3','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore;
|
||||
UTL_FILE.put_line(file1,'SDNRESP45'||';'||''||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||valore||';'||''||';');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm)
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP48.sql
Normal file
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP48.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--L'indicatore riporta il numero totale di richieste di cessazione inviate giornalmente a SIMBA.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
Select count(*), sysdate
|
||||
FROM MNP_ASP_CRM_CESSAZIONE_OUT
|
||||
WHERE data_invio > trunc(sysdate)-1/86400
|
||||
and data_invio < trunc(sysdate+1)
|
||||
AND substr(nome_file,1,16) = 'MNP_SIMBA_DONOR_'
|
||||
and da_inviare=0
|
||||
and sist_comp='SIMBA';
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP48'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
39
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP49.sql
Normal file
39
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP49.sql
Normal file
@@ -0,0 +1,39 @@
|
||||
--L'indicatore riporta il numero totale di notifiche di cessazione ancora non inviate a SIMBA.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
Select count(*), sysdate
|
||||
FROM MNP_ASP_CRM_CESSAZIONE_OUT
|
||||
WHERE data_invio is null
|
||||
and nome_file is null
|
||||
AND sist_comp='SIMBA'
|
||||
and da_inviare=1;
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP49'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP50.sql
Normal file
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP50.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--L'indicatore riporta il numero totale di richieste di cessazione inviate giornalmente a DPPS.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
Select count(*), sysdate
|
||||
FROM MNP_ASP_CRM_CESSAZIONE_OUT
|
||||
WHERE data_invio > trunc(sysdate)-1/86400
|
||||
and data_invio < trunc(sysdate+1)
|
||||
AND substr(nome_file,1,15) = 'MNP_DPPS_DONOR_'
|
||||
and sist_comp='DPPS'
|
||||
and da_inviare=0;
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP50'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP51.sql
Normal file
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP51.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--L'indicatore riporta il numero totale di notifiche di cessazione ancora non inviate a DPPS.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
Select count(*), sysdate
|
||||
FROM MNP_ASP_CRM_CESSAZIONE_OUT
|
||||
WHERE data_invio is null
|
||||
and nome_file is null
|
||||
and sist_comp='DPPS'
|
||||
and da_inviare=1;
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP51'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP52.sql
Normal file
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP52.sql
Normal file
@@ -0,0 +1,41 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Consumer Prepagato
|
||||
--validate positivamente ancora da cessare con data cut-over non trascorsa.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta
|
||||
where tipo_cliente='CO'
|
||||
and abbonato_prepagato='PREPAGATO'
|
||||
and stato in (7,9,14)
|
||||
and data_cut_over_calc>sysdate;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP52'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP53.sql
Normal file
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP53.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Business Prepagato
|
||||
--validate positivamente ancora da cessare con data cut-over non trascorsa.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta
|
||||
where tipo_cliente='BU'
|
||||
and abbonato_prepagato='PREPAGATO'
|
||||
and stato in (7,9,14)
|
||||
and data_cut_over_calc>sysdate;
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP53'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP54.sql
Normal file
41
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP54.sql
Normal file
@@ -0,0 +1,41 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Consumer Prepagato
|
||||
--validate positivamente ancora da cessare con data cut-over trascorsa.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta
|
||||
where tipo_cliente='CO'
|
||||
and abbonato_prepagato='PREPAGATO'
|
||||
and stato in (7,9,14)
|
||||
and data_cut_over_calc<sysdate;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP54'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||valore||';;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP55.sql
Normal file
40
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP55.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--L'indicatore riporta il numero totale di richieste di tipo Business Prepagato
|
||||
--validate positivamente ancora da cessare con data cut-over trascorsa.
|
||||
--I dati non sono aggregati per alcun attributo.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a
|
||||
where tipo_cliente='BU'
|
||||
and abbonato_prepagato='PREPAGATO'
|
||||
and stato in (7,9,14)
|
||||
and data_cut_over_calc<sysdate;
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP55'||';;'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';;;');
|
||||
close cur_valore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
53
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP56.sql
Normal file
53
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP56.sql
Normal file
@@ -0,0 +1,53 @@
|
||||
--L'indicatore riporta il numero totale di notifiche di esito espletamento prodotte
|
||||
--in giornata da DBC per CIRCE. I dati sono aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quanti sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select a.desc_olo from mnp_olo a
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
Select count(*), sysdate
|
||||
FROM MNP_CIRCE_OUT
|
||||
where trunc(to_date(substr(nome_file,17,8),'yyyymmdd')) = trunc(sysdate)
|
||||
AND stato='05'
|
||||
AND codice_operatore_recipient=operatore
|
||||
and nome_file is not null
|
||||
and da_inviare=0;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%notfound;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP56'||';'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
66
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP57.sql
Normal file
66
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP57.sql
Normal file
@@ -0,0 +1,66 @@
|
||||
--L'indicatore riporta il numero totale di notifiche di esito espletamento ancora da produrre per CIRCE.
|
||||
--I dati sono aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quanti sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select a.desc_olo from mnp_olo a
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
SELECT COUNT (*), SYSDATE
|
||||
FROM mnp_mss_cessazione_in a, mnp_gestione_richiesta b
|
||||
WHERE a.da_processare = 0
|
||||
AND a.id_richiesta = b.id_richiesta
|
||||
AND b.codice_operatore_recipient = operatore
|
||||
AND b.stato = 16
|
||||
AND a.id_richiesta IN
|
||||
(SELECT b.id_richiesta
|
||||
FROM mnp_mss_cessazione_in a,
|
||||
mnp_gestione_richiesta b
|
||||
WHERE a.da_processare = 0
|
||||
AND a.id_richiesta = b.id_richiesta
|
||||
AND b.codice_operatore_recipient = operatore
|
||||
AND b.stato = 16
|
||||
MINUS
|
||||
SELECT c.id_richiesta
|
||||
FROM mnp_circe_out c
|
||||
WHERE c.stato = '05'
|
||||
AND c.da_inviare = 0
|
||||
AND c.codice_operatore_recipient = operatore);
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%notfound;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP57'||';'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
61
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP57A.sql
Normal file
61
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP57A.sql
Normal file
@@ -0,0 +1,61 @@
|
||||
--L'indicatore riporta il numero totale di notifiche di esito espletamento ancora da produrre per CIRCE.
|
||||
--I dati sono aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quanti sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select a.desc_olo from mnp_olo a
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
SELECT COUNT (*), SYSDATE
|
||||
FROM mnp_mss_cessazione_in a, mnp_gestione_richiesta b, MNP_STORICO_RICHIESTA d
|
||||
WHERE a.da_processare = 0
|
||||
AND a.id_richiesta = b.id_richiesta
|
||||
AND b.id_richiesta = d.id_richiesta
|
||||
AND b.codice_operatore_recipient = operatore
|
||||
AND b.stato = 16
|
||||
and d.stato_a = 16
|
||||
and trunc(d.data_lavorazione) = trunc(sysdate)
|
||||
AND NOT EXISTS (
|
||||
SELECT c.id_richiesta
|
||||
FROM mnp_circe_out c
|
||||
WHERE c.stato = '05'
|
||||
AND c.da_inviare = 0
|
||||
AND c.id_richiesta = b.id_richiesta);
|
||||
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%notfound;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP57A'||';'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
56
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP58.sql
Normal file
56
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP58.sql
Normal file
@@ -0,0 +1,56 @@
|
||||
--L'indicatore riporta il numero totale di notifiche di ritardo espletamento
|
||||
--inviate in giornata da DBC a CIRCE.
|
||||
--I dati sono aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quanti sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select a.desc_olo from mnp_olo a
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
Select count(*), sysdate
|
||||
FROM MNP_CIRCE_OUT
|
||||
WHERE da_inviare = 0
|
||||
and nome_file is not null
|
||||
AND trunc(to_date(substr(nome_file,17,8),'yyyymmdd')) = trunc(sysdate)
|
||||
AND stato = '06'
|
||||
and codice_operatore_recipient=operatore;
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%notfound;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP58'||';'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
|
||||
61
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP59.sql
Normal file
61
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP59.sql
Normal file
@@ -0,0 +1,61 @@
|
||||
--L'indicatore riporta il numero totale di notifiche di ritardo espletamento
|
||||
--ancora da inviare da DBC a CIRCE.
|
||||
--I dati sono aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Vengono prodotti tanti record riportanti ognuno il totale per quanti sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select a.desc_olo from mnp_olo a
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
SELECT COUNT (*), SYSDATE
|
||||
FROM mnp_gestione_richiesta a
|
||||
WHERE a.stato IN (7, 9, 14) --VALIDATAOK, ACCETTATA, INCESSAZIONE
|
||||
AND TRUNC (SYSDATE) >= TRUNC (a.data_cut_over_calc)
|
||||
AND a.codice_operatore_recipient=operatore
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 --nessun esito da MSS
|
||||
FROM mnp_mss_cessazione_in c
|
||||
WHERE c.id_richiesta = a.id_richiesta
|
||||
UNION
|
||||
SELECT 1 --non notificata a CIRCE
|
||||
FROM mnp_circe_out b
|
||||
WHERE b.id_richiesta = a.id_richiesta
|
||||
AND b.da_inviare = 0
|
||||
AND b.stato = '06');
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%notfound;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP59'||';'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
58
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP59A.sql
Normal file
58
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP59A.sql
Normal file
@@ -0,0 +1,58 @@
|
||||
--L'indicatore riporta il numero totale di notifiche di ritardo espletamento
|
||||
--ancora da inviare da DBC a CIRCE (nel giorno).
|
||||
--I dati sono aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Vengono prodotti tanti record riportanti ognuno il totale per quanti sono i possibili OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
set serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select a.desc_olo from mnp_olo a
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
SELECT count(*), sysdate
|
||||
FROM MNP_GESTIONE_RICHIESTA GR, mnp_MSS_cessazione_in ms
|
||||
WHERE GR.STATO in (7,9,14)
|
||||
AND trunc(sysdate) = trunc(GR.data_cut_over_calc)
|
||||
AND gr.id_richiesta = ms.id_richiesta(+)
|
||||
AND ms.id_richiesta is null
|
||||
and gr.codice_operatore_recipient=operatore
|
||||
and gr.id_richiesta not in
|
||||
(Select a.id_richiesta
|
||||
FROM MNP_CIRCE_OUT a
|
||||
WHERE a.da_inviare=0
|
||||
AND a.stato='06'
|
||||
and a.codice_operatore_recipient=operatore);
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%notfound;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP59A'||';'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
95
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP60.sql
Normal file
95
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP60.sql
Normal file
@@ -0,0 +1,95 @@
|
||||
--L'indicatore riporta giornalmente il tempo medio impiegato per il passaggio di stato
|
||||
--da "acquisita" a "espletata" per i PROGETTI AD HOC.
|
||||
--Il tempo medio calcolato è suddiviso per: Tipologia Cliente (CO/BU).
|
||||
--Sono prodotti tanti record riportanti ognuno il tempo medio calcolato
|
||||
--per ognuna delle tipologie cliente previste.
|
||||
--Il dato è calcolato giornalmente per le richieste che nella giornata di
|
||||
--rilevazione hanno subito un passaggio nello stato di "espletata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste
|
||||
--che sono transitate nello stato "espletata" il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
data_acq date;
|
||||
data_prc date;
|
||||
giorni_diff number(10):=0;
|
||||
i number(10):=0;
|
||||
media varchar2(10);
|
||||
somma number(10):=0;
|
||||
var_tipo_cliente varchar2(2);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_date is
|
||||
select trunc(a.data_lavorazione),trunc(b.data_lavorazione)
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c
|
||||
where a.stato_a=1
|
||||
and b.stato_a=16
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and (c.richiestaadhocaom=1 or c.richiestaadhoc=1);
|
||||
|
||||
cursor cur_giorni_diff is
|
||||
select count(*)-1
|
||||
from s_dim_tempo a
|
||||
where a.data between data_acq and data_prc
|
||||
and a.tip_gio not in ('P','F');
|
||||
|
||||
BEGIN
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
--calcolo la media
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
|
||||
open cur_date;
|
||||
i:=0;
|
||||
media:='-';
|
||||
somma:=0;
|
||||
loop
|
||||
data_val:=sysdate;
|
||||
|
||||
fetch cur_date into data_acq, data_prc;
|
||||
exit when cur_date%notfound;
|
||||
|
||||
open cur_giorni_diff;
|
||||
fetch cur_giorni_diff into giorni_diff;
|
||||
|
||||
somma:= somma + giorni_diff;
|
||||
i:=i+1;
|
||||
|
||||
|
||||
close cur_giorni_diff;
|
||||
end loop;
|
||||
close cur_date;
|
||||
if(i!=0) then
|
||||
media:=to_char(round(somma/i,2));
|
||||
end if;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP60'||';'||var_tipo_cliente||';'||media||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
94
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP61.sql
Normal file
94
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP61.sql
Normal file
@@ -0,0 +1,94 @@
|
||||
--L'indicatore riporta giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"acquisita" a "espletata" per i PROGETTI AD HOC.
|
||||
--Il tempo massimo rilevato è suddiviso per:
|
||||
--Tipologia Cliente (CO/BU).
|
||||
--Sono prodotti tanti record riportanti ognuno il tempo massimo rilevato
|
||||
--per ognuna delle tipologie cliente previste. Il dato è calcolato giornalmente
|
||||
--per le richieste che nella giornata di rilevazione hanno subito un passaggio nello stato di "espletata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "espletata"
|
||||
--il dato non viene rilevato.
|
||||
--Il record però è prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato sono presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=1
|
||||
and b.stato_a=16
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and (c.richiestaadhocaom=1 or c.richiestaadhoc=1)
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=16
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente
|
||||
and (b.richiestaadhocaom=1 or b.richiestaadhoc=1);
|
||||
|
||||
id_rich_max:=trunc(rich_prc/100*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP61'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP61'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
64
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP64.sql
Normal file
64
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP64.sql
Normal file
@@ -0,0 +1,64 @@
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR
|
||||
--cessate sulla rete Tim nel giorno ma in ritardo rispetto alla data cut-over prevista.
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale per quante sono
|
||||
--le possibili combinazioni dell'aggregazione: Tipologia Cliente-OLO Recipient
|
||||
--(ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(*), sysdate
|
||||
from mnp_gestione_richiesta a, mnp_storico_richiesta b
|
||||
where a.id_richiesta=b.id_richiesta
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.data_cut_over_calc < trunc(sysdate)
|
||||
and a.tipo_cliente=var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore;
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP64'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP65.sql
Normal file
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP65.sql
Normal file
@@ -0,0 +1,93 @@
|
||||
--L'indicatore deve riportare giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"Accettata" a "in cessazione" del 95% delle richieste.
|
||||
--Il tempo massimo rilevato deve essere suddiviso per: Tipologia Cliente (CO/BU).
|
||||
--Devono essere prodotti tanti record riportanti ognuno il tempo massimo rilevato
|
||||
--per ognuna delle tipologie cliente previste.
|
||||
--Il dato deve essere calcolato giornalmente per le richieste che nella giornata
|
||||
--di rilevazione hanno subito un passaggio nello stato di "in cessazione".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "in cessazione"
|
||||
--il dato non viene rilevato. Il record però deve essere prodotto anche in questo caso associando
|
||||
--all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato devono essere presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=9
|
||||
and b.stato_a=14
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=14
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
id_rich_max:=trunc(rich_prc/95*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP65'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP65'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP66.sql
Normal file
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP66.sql
Normal file
@@ -0,0 +1,93 @@
|
||||
--L'indicatore deve riportare giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"Accettata" a "cessata" del 95% delle richieste.
|
||||
--Il tempo massimo rilevato deve essere suddiviso per: Tipologia Cliente (CO/BU).
|
||||
--Devono essere prodotti tanti record riportanti ognuno il tempo massimo rilevato
|
||||
--per ognuna delle tipologie cliente previste.
|
||||
--Il dato deve essere calcolato giornalmente per le richieste che nella giornata di
|
||||
--rilevazione hanno subito un passaggio nello stato di "cessata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "cessata"
|
||||
--il dato non viene rilevato.
|
||||
--Il record però deve essere prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato devono essere presi in considerazione solo i giorni lavorativi.
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=9
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=15
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
id_rich_max:=trunc(rich_prc/95*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP66'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP66'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
|
||||
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP67.sql
Normal file
93
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP67.sql
Normal file
@@ -0,0 +1,93 @@
|
||||
--L'indicatore deve riportare giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"in cessazione" a "cessata" (su rete Tim) del 95% delle richieste.
|
||||
--Il tempo massimo rilevato deve essere suddiviso per: Tipologia Cliente (CO/BU).
|
||||
--Devono essere prodotti tanti record riportanti ognuno il tempo massimo rilevato
|
||||
--per ognuna delle tipologie cliente previste.
|
||||
--Il dato deve essere calcolato giornalmente per le richieste che nella giornata di rilevazione
|
||||
--hanno subito un passaggio nello stato di "cessata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "cessata"
|
||||
--il dato non viene rilevato. Il record però deve essere prodotto anche in questo caso
|
||||
--associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato devono essere presi in considerazione solo i giorni lavorativi.
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=14
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=15
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
id_rich_max:=trunc(rich_prc/95*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP67'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP67'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
92
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP68.sql
Normal file
92
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP68.sql
Normal file
@@ -0,0 +1,92 @@
|
||||
--L'indicatore deve riportare giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"cessata" a "espletata" del 95% delle richieste.
|
||||
--Il tempo massimo rilevato deve essere suddiviso per:
|
||||
--Tipologia Cliente (CO/BU). Devono essere prodotti tanti record riportanti ognuno il
|
||||
--tempo massimo rilevato per ognuna delle tipologie cliente previste.
|
||||
--Il dato deve essere calcolato giornalmente per le richieste che nella giornata di rilevazione
|
||||
--hanno subito un passaggio nello stato di "espletata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "espletata"
|
||||
--il dato non viene rilevato.
|
||||
--Il record però deve essere prodotto anche in questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato devono essere presi in considerazione solo i giorni lavorativi.
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=15
|
||||
and b.stato_a=16
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=16
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente;
|
||||
|
||||
id_rich_max:=trunc(rich_prc/95*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP68'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP68'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
95
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP69.sql
Normal file
95
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP69.sql
Normal file
@@ -0,0 +1,95 @@
|
||||
--L'indicatore deve riportare giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"acquisita" a "cessata" del 95% delle richieste.
|
||||
--Il tempo massimo rilevato deve essere suddiviso per: Tipologia Cliente (CO/BU).
|
||||
--Devono essere prodotti tanti record riportanti ognuno il tempo massimo rilevato per ognuna delle
|
||||
--tipologie cliente previste.
|
||||
--Il dato deve essere calcolato giornalmente per le richieste che nella giornata di rilevazione hanno
|
||||
--subito un passaggio nello stato di "cessata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato
|
||||
--"cessata" il dato non viene rilevato. Il record però deve essere prodotto anche in
|
||||
--questo caso associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato devono essere presi in considerazione solo i giorni lavorativi.
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=1
|
||||
and b.stato_a=15
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and (c.richiestaadhocaom=1 or c.richiestaadhoc=1)
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=15
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente
|
||||
and (b.richiestaadhocaom=1 or b.richiestaadhoc=1);
|
||||
|
||||
id_rich_max:=trunc(rich_prc/95*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP69'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP69'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
96
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP70.sql
Normal file
96
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP70.sql
Normal file
@@ -0,0 +1,96 @@
|
||||
--L'indicatore deve riportare giornalmente il tempo massimo rilevato per il passaggio di stato da
|
||||
--"acquisita" a "espletata" del 95% delle richieste per i PROGETTI AD HOC.
|
||||
--Il tempo massimo rilevato deve essere suddiviso per: Tipologia Cliente (CO/BU).
|
||||
--Devono essere prodotti tanti record riportanti ognuno il tempo massimo rilevato per ognuna delle
|
||||
--tipologie cliente previste.
|
||||
--Il dato deve essere calcolato giornalmente per le richieste che nella giornata di
|
||||
--rilevazione hanno subito un passaggio nello stato di "espletata".
|
||||
--Per cui se nella giornata di rilevazione non esistono richieste che sono transitate nello stato "espletata"
|
||||
--il dato non viene rilevato. Il record però deve essere prodotto anche in questo caso
|
||||
--associando all'indicatore il valore '-' (trattino).
|
||||
--Nel calcolo dei tempi di passaggio di stato devono essere presi in considerazione solo i giorni lavorativi.
|
||||
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
DECLARE
|
||||
|
||||
id_richiesta varchar2(23);
|
||||
gg number(10):=0;
|
||||
rich_prc number(10):=0;
|
||||
id_rich_max number(10):=0;
|
||||
data_val date;
|
||||
var_tipo_cliente varchar2(2);
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_giorni is
|
||||
select abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione)) - sum(decode(tip_gio,'F',1,'P',1,0)) giorni, c.id_richiesta
|
||||
,sysdate
|
||||
from mnp_storico_richiesta a,mnp_storico_richiesta b, mnp_gestione_richiesta c, s_dim_tempo d
|
||||
where a.stato_a=1
|
||||
and b.stato_a=16
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and b.id_richiesta=c.id_richiesta
|
||||
and c.tipo_cliente=var_tipo_cliente
|
||||
and (c.richiestaadhocaom=1 or c.richiestaadhoc=1)
|
||||
and d.data>=a.data_lavorazione and d.data<=b.data_lavorazione
|
||||
group by c.id_richiesta,abs(trunc(b.data_lavorazione) - trunc(a.data_lavorazione))
|
||||
order by giorni;
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
for j in 0..1 loop
|
||||
if (j=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
select count(*) into rich_prc
|
||||
from mnp_storico_richiesta a, mnp_gestione_richiesta b
|
||||
where a.stato_a=16
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and a.data_lavorazione < trunc(sysdate+1)
|
||||
and b.tipo_cliente=var_tipo_cliente
|
||||
and (b.richiestaadhocaom=1 or b.richiestaadhoc=1);
|
||||
|
||||
id_rich_max:=trunc(rich_prc/95*100);
|
||||
rich_prc:=0;
|
||||
|
||||
open cur_giorni;
|
||||
loop
|
||||
fetch cur_giorni into gg, id_richiesta,data_val;
|
||||
exit when cur_giorni%notfound;
|
||||
rich_prc:=rich_prc+1;
|
||||
if(rich_prc=id_rich_max) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP70'||';'||var_tipo_cliente||';'||gg||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
exit;
|
||||
end if;
|
||||
end loop;
|
||||
if(rich_prc=0) then
|
||||
UTL_FILE.put_line(file1,'SDNRESP70'||';'||var_tipo_cliente||';'||'-'||';'
|
||||
||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||';;');
|
||||
end if;
|
||||
close cur_giorni;
|
||||
end loop;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
|
||||
70
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP71.sql
Normal file
70
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP71.sql
Normal file
@@ -0,0 +1,70 @@
|
||||
-- [ SDNRESP71 ]
|
||||
--L'indicatore riporta il numero totale di richieste MNP DONOR poste
|
||||
--giornalmente nello stato "Bloccata" su DBC.
|
||||
--I dati sono aggregati per:
|
||||
--Tipologia Cliente e per OLO Recipient.
|
||||
--Sono prodotti tanti record riportanti ognuno
|
||||
--il totale per quante sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente e per OLO Recipient.
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(3);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
|
||||
begin
|
||||
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
|
||||
for i in 0..1
|
||||
loop
|
||||
if (i=0) then var_tipo_cliente:='CO';
|
||||
else var_tipo_cliente:='BU';
|
||||
end if;
|
||||
|
||||
select count(*), sysdate into valore, data_val
|
||||
from mnp_gestione_richiesta a, mnp_storico_richiesta b
|
||||
where b.stato_a = 99
|
||||
and b.data_lavorazione > trunc(sysdate)-1/86400
|
||||
and b.data_lavorazione < trunc(sysdate+1)
|
||||
and a.id_richiesta=b.id_richiesta
|
||||
and a.tipo_cliente= var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore;
|
||||
|
||||
UTL_FILE.put_line(file1,'SDNRESP71'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
|
||||
end loop; -- fine for
|
||||
|
||||
end loop; --fine operatore
|
||||
close cur_operatore;
|
||||
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
|
||||
end;
|
||||
/
|
||||
exit
|
||||
65
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP72.sql
Normal file
65
dbcmnpsrc/FE/mnpapp/script/governance/sql/SDNRESP72.sql
Normal file
@@ -0,0 +1,65 @@
|
||||
--Numero totale di richieste DONOR da cessare nel giorno,
|
||||
--cioè con data cut over uguale alla data di sistema, per cui MSS non ha inviato gli esiti.
|
||||
--I dati sono aggregati per: Tipologia Cliente (CO/BU) e per OLO Recipient (WIND-H3GI-OPIV, etc.).
|
||||
--Sono prodotti tanti record riportanti ognuno il totale
|
||||
--per quante sono le possibili combinazioni dell'aggregazione:
|
||||
--Tipologia Cliente-OLO Recipient (ES: BU-WIND).
|
||||
--Il record è prodotto anche nel caso il valore rilevato sia "zero".
|
||||
SET serveroutput on
|
||||
|
||||
declare
|
||||
operatore varchar2(4);
|
||||
var_tipo_cliente varchar2(2);
|
||||
valore varchar2(255);
|
||||
data_val date;
|
||||
file1 UTL_FILE.file_type;
|
||||
freq varchar2(255):='&1';
|
||||
|
||||
cursor cur_operatore is
|
||||
select desc_olo from mnp_olo
|
||||
where flag_terze_parti=1;
|
||||
|
||||
cursor cur_valore is
|
||||
select count(a.ID_RICHIESTA),sysdate
|
||||
from MNP_GESTIONE_RICHIESTA a --richieste DONOR
|
||||
where a.STATO = 14 --in cessazione
|
||||
and a.tipo_cliente=var_tipo_cliente
|
||||
and a.codice_operatore_recipient=operatore
|
||||
and trunc(a.DATA_CUT_OVER_CALC) = trunc(sysdate) --entro oggi
|
||||
and not exists --MSS non ha ancora risposto
|
||||
(select 1
|
||||
from MNP_MSS_CESSAZIONE_IN b
|
||||
where b.ID_RICHIESTA=a.ID_RICHIESTA);
|
||||
|
||||
begin
|
||||
dbms_output.put_line('apro il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
file1 := UTL_FILE.fopen('&2','MNP' || '.' || to_char(sysdate,'yyyyMMdd'),'a');
|
||||
open cur_operatore;
|
||||
loop
|
||||
fetch cur_operatore into operatore;
|
||||
exit when cur_operatore%NOTFOUND;
|
||||
for i in 0..1 loop
|
||||
if (i=0) then
|
||||
var_tipo_cliente:='CO';
|
||||
else
|
||||
var_tipo_cliente:='BU';
|
||||
end if;
|
||||
open cur_valore;
|
||||
fetch cur_valore into valore, data_val;
|
||||
UTL_FILE.put_line(file1,'SDNRESP72'||';'||var_tipo_cliente||'-:-'||operatore||';'||valore||';'||freq||';'||'&3'|| ';'
|
||||
||to_char(data_val,'yyyymmdd')||';'||to_char(data_val,'hh24:mi:ss') ||';'
|
||||
||to_char(sysdate,'yyyymmdd')||';'||to_char(sysdate,'hh24:mi:ss') ||';'
|
||||
||'0'||';'||var_tipo_cliente||'-:-'||operatore||';;');
|
||||
close cur_valore;
|
||||
end loop;
|
||||
end loop;
|
||||
close cur_operatore;
|
||||
UTL_FILE.fflush(file1);
|
||||
UTL_FILE.fclose(file1);
|
||||
dbms_output.put_line('chiudo il file ' || 'MNP' || '.' || to_char(sysdate,'yyyyMMdd'));
|
||||
exception
|
||||
when others then
|
||||
DBMS_OUTPUT.PUT_LINE(sqlerrm);
|
||||
end;
|
||||
/
|
||||
exit
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user