First Commit - Source Code from Reply

This commit is contained in:
vincenzofariello
2024-05-13 12:54:14 +02:00
parent 73e32a5020
commit a15aee1f08
11184 changed files with 1065913 additions and 0 deletions

View 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

View File

@@ -0,0 +1,75 @@
/* Formatted on 2006/01/12 18:11 (Formatter Plus v4.8.0) */
--Lindicatore 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -0,0 +1,62 @@
--L'indicatore riporta il numero totale di richieste MNP DONOR
--che si trovano ancora nello stato "Acquisita" (e quindi non ancora prese in carico )
--per le quali la data di ricezione (data di acquisizione richiesta)
-- sia antecedente alla data di sistema.
--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 deve essere 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=1
and a.tipo_cliente=var_tipo_cliente
and a.codice_operatore_recipient=operatore
and a.dataricezionerichiesta < 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_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,'SDNRPIC01'||';'||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

View File

@@ -0,0 +1,62 @@
--L'indicatore riporta il numero totale di richieste MNP DONOR
--che si trovano ancora nello stato "Acquisita" (e quindi non ancora prese in carico )
--per le quali la data di ricezione (data di acquisizione richiesta)
-- sia uguale al giorno precedente la data di sistema (sysdate - 1).
--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 deve essere 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=1
and a.tipo_cliente=var_tipo_cliente
and a.codice_operatore_recipient=operatore
and trunc(a.dataricezionerichiesta) = trunc(dwh.FUN_GIORNI_MENO(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_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,'SDNRPIC01A'||';'||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

View File

@@ -0,0 +1,56 @@
--L'indicatore riporta il numero totale di notifiche di prese in carico
--richieste MNP DONOR inviate giornalmente agli OLO Recipient.
--I dati sono aggregati per:
--OLO Recipient (WIND-H3GI-OPIV, etc.).
--Sono prodotti tanti record riportanti ognuno il totale per quante
--sono i possibili OLO Recipient.
--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_xml_richiesta_out a, mnp_xml_out b
where a.nome_file=b.nome_file
and b.tipo_file='5'
and b.numero_invii>=1
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,'SDNRPIC06'||';'||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

View File

@@ -0,0 +1,61 @@
--L'indicatore riporta il numero totale di richieste MNP DONOR
--poste giornalmente nello stato "Presa in Carico" 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".
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 b.stato_a=3
and a.id_richiesta=b.id_richiesta
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,'SDNRPIC11'||';'||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

View File

@@ -0,0 +1,54 @@
--L'indicatore riporta il numero totale di richieste MNP DONOR
--poste giornalmente nello stato "Scartata per Overflow" su 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
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_gestione_richiesta a, mnp_storico_richiesta b
where a.id_richiesta = b.id_richiesta
and b.stato_a=4
and b.data_lavorazione > trunc(sysdate)-1/86400
and b.data_lavorazione < trunc(sysdate+1)
and a.cod_controllo_presaincarico=8
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,'SDNRPIC12'||';'||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

View File

@@ -0,0 +1,53 @@
--L'indicatore deve riportare il numero totale di richieste MNP DONOR
--poste giornalmente nello stato "Scartata per Waiting List" su DBC.
--I dati devono essere aggregati per: OLO Recipient (WIND-H3GI-OPIV, etc.).
--Devono essere prodotti tanti record riportanti ognuno il totale per
--quanti sono i possibili OLO Recipient.
--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_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=4
and b.data_lavorazione > trunc(sysdate)-1/86400
and b.data_lavorazione < trunc(sysdate+1)
and a.cod_controllo_presaincarico=7
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,'SDNRPIC13'||';'||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

View File

@@ -0,0 +1,65 @@
--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 successivo alla 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, mnp_storico_richiesta c
where a.id_richiesta=b.id_richiesta
and a.id_richiesta=c.id_richiesta
and c.id_richiesta=b.id_richiesta
and b.stato_a=12
and c.stato_a=3
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,'SDNRPIC16'||';'||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;
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);
close cur_operatore;
end;
/
exit

View File

@@ -0,0 +1,93 @@
--L'indicatore riporta giornalmente il tempo medio impiegato per il passaggio di stato
--da "Acquisita" a "Presa in Carico" delle richieste MNP DONOR.
--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 sono state Prese in Carico.
--Per cui se nella giornata di rilevazione non esistono richieste che sono state
--Prese in Carico 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=3
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;
somma:=0;
media:='-';
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,'SDNRPIC17'||';'||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

View File

@@ -0,0 +1,97 @@
--L'indicatore riporta giornalmente il tempo massimo impiegato per il passaggio di stato da
--"Acquisita" a "Presa in Carico" delle richieste MNP DONOR.
--Il tempo massimo calcolato è suddiviso per:
--Tipologia Cliente (CO/BU).
--Sono prodotti tanti record riportanti ognuno il tempo massimo calcolato
--per ognuna delle tipologie cliente previste.
--Il dato è calcolato giornalmente per le richieste che nella
--giornata di rilevazione sono state Prese in Carico.
--Per cui se nella giornata di rilevazione non esistono richieste che sono state Prese in Carico
--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=3
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=3
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:=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,'SDNRPIC18'||';'||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,'SDNRPIC18'||';'||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

View File

@@ -0,0 +1,94 @@
--L'indicatore riporta giornalmente il tempo massimo rilevato per il passaggio di stato da
--"Acquisita" a "Presa in Carico" del 95% delle richieste MNP DONOR.
--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 sono state Prese in Carico.
--Per cui se nella giornata di rilevazione non esistono richieste che sono
--state Prese in Carico 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=3
and trunc(b.data_lavorazione)=trunc(sysdate)
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=3
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*95);
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,'SDNRPIC19'||';'||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,'SDNRPIC19'||';'||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

View File

@@ -0,0 +1,38 @@
--L'indicatore deve riportare il numero totale di richieste poste in Waiting List ed OverFlow
--inviate giornalmente a BIT a scopo di Retention. 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);
data_val date;
file1 UTL_FILE.file_type;
freq varchar2(255):='&1';
cursor cur_valore is
select count(id_prog),sysdate
from MNP_CRM_RETENTION_OUT
where TRUNC (data_invio) = 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,'SDNRPIC22'||';;'||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

View File

@@ -0,0 +1,40 @@
--L'indicatore deve riportare il numero totale di richieste poste in Waitnig List ed OverFlow
--che dovevano essere inviati in giornata a scopo di Retention ma ancora non inviate a BIT per problemi applicativi.
--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);
data_val date;
file1 UTL_FILE.file_type;
freq varchar2(255):='&1';
cursor cur_valore is
select count(id_prog),sysdate
from MNP_CRM_RETENTION_OUT
where TRUNC (data_creazione) = TRUNC (SYSDATE)
and data_invio is null;
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,'SDNRPIC23'||';;'||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

View File

@@ -0,0 +1,40 @@
--L'indicatore deve riportare il numero totale di richieste donor Consumer prese in carico nel giorno
--inviate a CCRM. 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);
data_val date;
file1 UTL_FILE.file_type;
freq varchar2(255):='&1';
cursor cur_valore is
select count(S.id_prog),sysdate
from MNP_SMS_L1 S, MNP_FLUSSO_DEST F
where S.NOME_FILE=F.NOME_FILE
and F.DESTINATARIO='CCRM'
and TRUNC(F.data_invio) = 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,'SDNRPIC24'||';;'||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

View File

@@ -0,0 +1,40 @@
--L'indicatore deve riportare il numero totale di richieste donor Consumer prese in carico nel giorno
--non inviate a CCRM. 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);
data_val date;
file1 UTL_FILE.file_type;
freq varchar2(255):='&1';
cursor cur_valore is
select count(S.id_prog),sysdate
from MNP_SMS_L1 S, MNP_FLUSSO_DEST F
where (S.NOME_FILE is null) OR (S.NOME_FILE=F.NOME_FILE
and F.DESTINATARIO='CCRM'
and F.data_invio is null);
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,'SDNRPIC25'||';;'||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

View File

@@ -0,0 +1,40 @@
--L'indicatore deve riportare il numero totale di richieste donor Consumer prese in carico nel giorno
--inviate a GISP. 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);
data_val date;
file1 UTL_FILE.file_type;
freq varchar2(255):='&1';
cursor cur_valore is
select count(S.id_prog),sysdate
from MNP_SMS_L1 S, MNP_FLUSSO_DEST F
where S.NOME_FILE=F.NOME_FILE
and F.DESTINATARIO='GISP'
and TRUNC(F.data_invio) = 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,'SDNRPIC26'||';;'||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

View File

@@ -0,0 +1,40 @@
--L'indicatore deve riportare il numero totale di richieste donor Consumer prese in carico nel giorno
--non inviate a GISP. 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);
data_val date;
file1 UTL_FILE.file_type;
freq varchar2(255):='&1';
cursor cur_valore is
select count(S.id_prog),sysdate
from MNP_SMS_L1 S, MNP_FLUSSO_DEST F
where (S.NOME_FILE is null) OR (S.NOME_FILE=F.NOME_FILE
and F.DESTINATARIO='GISP'
and F.data_invio is null);
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,'SDNRPIC27'||';;'||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

View File

@@ -0,0 +1,39 @@
--L'indicatore deve riportare il numero totale di notifiche di scarti di prese in carico del giorno per waitinglist,
--overflow e manutenzione programmata che sono state inviate a CCRM. 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);
data_val date;
file1 UTL_FILE.file_type;
freq varchar2(255):='&1';
cursor cur_valore is
select count(id_prog),sysdate
from MNP_CCRM_NOTIFICA_OUT
where stato='SCARTATA'
and TRUNC(data_invio) = 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,'SDNRPIC28'||';;'||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

View File

@@ -0,0 +1,39 @@
--L'indicatore deve riportare il numero totale di notifiche di scarti di prese in carico del giorno per waitinglist,
--overflow e manutenzione programmata da inviare a CCRM. 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);
data_val date;
file1 UTL_FILE.file_type;
freq varchar2(255):='&1';
cursor cur_valore is
select count(id_prog),sysdate
from MNP_CCRM_NOTIFICA_OUT
where stato='SCARTATA'
and data_invio is null;
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,'SDNRPIC29'||';;'||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

View File

@@ -0,0 +1,80 @@
--L'indicatore riporta il numero totale di richieste MNP DONOR
--in stato "Presa in Carico" e ancora non inviate in validazione ai
--sistemi interni Tim, con data di validazione prevista successiva
--alla data di sistema.
--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);
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 -- caso consumer
select count(*), sysdate into valore, data_val
from mnp_gestione_richiesta a
where a.stato=3
and a.data_validazione_max > trunc(sysdate)
and a.tipo_cliente='CO'
and a.codice_operatore_recipient=operatore
and not exists (select b.id_richiesta
from mnp_ccrm_notifica_out b
where b.stato = 'IN VALIDAZIONE'
and b.da_scodare=0);
UTL_FILE.put_line(file1,'SDNRVAL00'||';'||'CO'||'-:-'||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'||';'||'CO'||'-:-'||operatore||';;');
else -- caso business
select count(*), sysdate into valore, data_val
from mnp_gestione_richiesta a
where a.stato=3
and a.data_validazione_max > trunc(sysdate)
and a.tipo_cliente='BU'
and a.codice_operatore_recipient=operatore
and not exists (select c.id_richiesta
from mnp_crm_validazione_out c
where c.da_inviare=0);
UTL_FILE.put_line(file1,'SDNRVAL00'||';'||'BU'||'-:-'||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'||';'||'BU'||'-:-'||operatore||';;');
end if;
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

View File

@@ -0,0 +1,76 @@
--L'indicatore riporta il numero totale di richieste MNP DONOR
--in stato "Presa in Carico" e ancora non inviate in validazione ai sistemi interni Tim
--con data di validazione prevista gia' trascorsa o uguale alla data di sistema.
--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);
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
select count(*), sysdate into valore, data_val
from mnp_gestione_richiesta a
where a.stato=3
and a.data_validazione_max <= trunc(sysdate)
and a.tipo_cliente='CO'
and a.codice_operatore_recipient=operatore
and not exists (select b.id_richiesta
from mnp_ccrm_notifica_out b
where b.stato = 'IN VALIDAZIONE' and b.da_scodare=0);
UTL_FILE.put_line(file1,'SDNRVAL01'||';'||'CO'||'-:-'||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'||';'||'CO'||'-:-'||operatore||';;');
else
select count(*), sysdate into valore, data_val
from mnp_gestione_richiesta a
where a.stato=3
and a.data_validazione_max <= trunc(sysdate)
and a.tipo_cliente='BU'
and a.codice_operatore_recipient=operatore
and not exists (select c.id_richiesta
from mnp_crm_validazione_out c
where c.da_inviare=0);
UTL_FILE.put_line(file1,'SDNRVAL01'||';'||'BU'||'-:-'||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'||';'||'BU'||'-:-'||operatore||';;');
end if;
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