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,28 @@
spool RU_173.log
SELECT lov_id, lov_name, name, descr
FROM mnp_lov
/
update mnp_lov
set descr='CESSAZIONE IN'
where lov_name='PROCESS' and name='C'
/
update mnp_lov
set descr='TERZE PARTI'
where lov_name='PROCESS' and name='P'
/
update mnp_lov
set descr='CESSAZIONE OUT'
where lov_name='PROCESS' and name='K'
/
update mnp_lov
set descr='P HOC'
where lov_name='XML_FILE_TYPE' and name='9'
/
update mnp_lov
set descr='PRESA IN CARICO'
where lov_name='XML_FILE_TYPE' and name='5'
/
commit;
spool off

View File

@@ -0,0 +1,31 @@
spool /mnpapp/log/script/RU_176.log
alter table dbcgo_lov
add (order_by number);
update dbcgo_lov set order_by=1 where lov_name='OT' and name='LO';
update dbcgo_lov set order_by=2 where lov_name='OT' and name='NO';
update dbcgo_lov set order_by=3 where lov_name='OT' and name='NE';
update dbcgo_lov set order_by=4 where lov_name='OT' and name='CN';
update dbcgo_lov set order_by=5 where lov_name='OT' and name='C';
update dbcgo_lov set order_by=6 where lov_name='OT' and name='S1';
update dbcgo_lov set order_by=7 where lov_name='OT' and name='S2';
update dbcgo_lov set order_by=8 where lov_name='OT' and name='NN';
update dbcgo_lov set order_by=1 where lov_name='OT_REC' and name='LO';
update dbcgo_lov set order_by=2 where lov_name='OT_REC' and name='NO';
update dbcgo_lov set order_by=3 where lov_name='OT_REC' and name='NE';
update dbcgo_lov set order_by=4 where lov_name='OT_REC' and name='CN';
update dbcgo_lov set order_by=5 where lov_name='OT_REC' and name='C';
update dbcgo_lov set order_by=6 where lov_name='OT_REC' and name='S1';
update dbcgo_lov set order_by=7 where lov_name='OT_REC' and name='S2';
update dbcgo_lov set order_by=8 where lov_name='OT_REC' and name='VEDG';
update dbcgo_lov set order_by=9 where lov_name='OT_REC' and name='N8VS';
update dbcgo_lov set order_by=10 where lov_name='OT_REC' and name='CCBU';
update dbcgo_lov set order_by=11 where lov_name='OT_REC' and name='CCCO';
update dbcgo_lov set order_by=12 where lov_name='OT_REC' and name='CUP';
update dbcgo_lov set order_by=13 where lov_name='OT_REC' and name='TS';
commit;
spool off

View File

@@ -0,0 +1,42 @@
DROP TABLE EXT_DWHT_VOLUMI_AOM;
CREATE TABLE EXT_DWHT_VOLUMI_AOM
(
MSISDN VARCHAR2(40 BYTE),
CODICE_OPERATORE VARCHAR2(6 BYTE),
NC NUMBER,
DC NUMBER
)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY DBCGO_DWHT_PATH
ACCESS PARAMETERS
( RECORDS DELIMITED BY NEWLINE
BADFILE 'ext_dwht_volumi_aom.bad'
LOGFILE 'ext_dwht_volumi_aom.log'
FIELDS TERMINATED BY ';'
)
LOCATION (DBCGO_DWHT_PATH:'DWHT_VOLUMI_AOM.DAT')
)
REJECT LIMIT UNLIMITED
PARALLEL 3
NOMONITORING;
ALTER TABLE DWHT_VOLUMI_AOM1
DROP CONSTRAINT DWHT_VOLUMI_AOM1_PK;
ALTER TABLE DWHT_VOLUMI_AOM0
DROP CONSTRAINT DWHT_VOLUMI_AOM0_PK;
ALTER TABLE DWHT_VOLUMI_AOM1 ADD
CONSTRAINT DWHT_VOLUMI_AOM1_PK
PRIMARY KEY (MSISDN, CODICE_OPERATORE)
USING INDEX
TABLESPACE DBCGO_IDX_BIG;
ALTER TABLE DWHT_VOLUMI_AOM0 ADD
CONSTRAINT DWHT_VOLUMI_AOM0_PK
PRIMARY KEY (MSISDN, CODICE_OPERATORE)
USING INDEX
TABLESPACE DBCGO_IDX_BIG;

View File

@@ -0,0 +1,9 @@
spool /mnpapp/log/script/SM_1582.log
alter table DWHT_VOLUMI_AOM0
modify (MSISDN varchar2(40), CODICE_OPERATORE varchar2(6));
alter table DWHT_VOLUMI_AOM1
modify (MSISDN varchar2(40), CODICE_OPERATORE varchar2(6));
spool off

View File

@@ -0,0 +1,24 @@
--execute as DBC
spool /mnpapp/log/script/dbc200604.log;
-----------------------------
--CREATE/MODIFY OBJECT
@@dbcDDL.sql
-----------------------------
--INSERT/UPDATE DATA
@@dbcDML.sql
-----------------------------
--COMPILE PROCEDURE
@/mnpapp/script/procedure/mnp/CALCOLA_SXMLIN.prc
show err
@/mnpapp/script/procedure/mnp/CALCOLA_SXMLOU.prc
show err
spool off;

View File

@@ -0,0 +1,151 @@
-- eseguire come utente MNP
---------------------------------------------------------------
--SEQUENCE
CREATE SEQUENCE SEQ_LOV;
CREATE SEQUENCE seq_dbcgo_notifica_porting_out;
---------------------------------------------------------------
--TABLE
ALTER TABLE mnp_dbcgo_notifica_donor_out
ADD (codice_operatore_donating VARCHAR2(4));
---------------------------------------------------------------
ALTER TABLE mnp_dbcgo_notifica_rec_out
ADD (codice_operatore_recipient VARCHAR2(4),
codice_gruppo VARCHAR2(12));
---------------------------------------------------------------
--------- codice dealer
---------------------------------------------------------------
ALTER TABLE mnp_sid_in
ADD (codice_dealer VARCHAR2(10));
---------------------------------------------------------------
ALTER TABLE mnp_sid_scarti_in
ADD (codice_dealer VARCHAR2(10));
---------------------------------------------------------------
ALTER TABLE mnp_msp_in_rec
ADD (codice_dealer VARCHAR2(10));
---------------------------------------------------------------
ALTER TABLE mnp_msp_scarti_in
ADD (codice_dealer VARCHAR2(10));
---------------------------------------------------------------
ALTER TABLE mnp_msc_in_rec
ADD (codice_dealer VARCHAR2(10));
---------------------------------------------------------------
ALTER TABLE mnp_msc_scarti_in
ADD (codice_dealer VARCHAR2(10));
---------------------------------------------------------------
ALTER TABLE mnp_gestione_richiesta_rec
ADD (codice_dealer VARCHAR2(10));
---------------------------------------------------------------
ALTER TABLE mnp_dbcgo_notifica_rec_out
ADD (codice_dealer VARCHAR2(10));
---------------------------------------------------------------
CREATE TABLE MNP_LOV
(
LOV_ID NUMBER NOT NULL,
LOV_NAME VARCHAR2(40 BYTE) NOT NULL,
NAME VARCHAR2(40 BYTE) NOT NULL,
DESCR VARCHAR2(200 BYTE) NOT NULL
)
TABLESPACE TAB_SMALL;
ALTER TABLE MNP_LOV ADD
CONSTRAINT PK_MNP_LOV
PRIMARY KEY (LOV_ID)
USING INDEX
TABLESPACE TAB_IDX_SMALL
ENABLE
VALIDATE;
CREATE UNIQUE INDEX AK0_MNP_LOV ON MNP_LOV
(LOV_NAME, NAME)
TABLESPACE TAB_IDX_SMALL;
---------------------------------------------------------------
CREATE TABLE MNP_LOV_REF
(
LOV_ID NUMBER NOT NULL,
LOV_ID_REF NUMBER NOT NULL
)
TABLESPACE TAB_SMALL;
ALTER TABLE MNP_LOV_REF ADD
CONSTRAINT PK_MNP_LOV_REF
PRIMARY KEY (LOV_ID,LOV_ID_REF)
USING INDEX
TABLESPACE TAB_IDX_SMALL
ENABLE
VALIDATE;
ALTER TABLE MNP_LOV_REF
ADD CONSTRAINT FK0_MNP_LOV_REF
FOREIGN KEY (LOV_ID)
REFERENCES MNP_LOV (LOV_ID)
ENABLE
VALIDATE;
ALTER TABLE MNP_LOV_REF
ADD CONSTRAINT FK1_MNP_LOV_REF
FOREIGN KEY (LOV_ID_REF)
REFERENCES MNP_LOV (LOV_ID)
ENABLE
VALIDATE;
---------------------------------------------------------------
CREATE TABLE mnp_dbcgo_notifica_porting_out
(
id_prog NUMBER(18,0) NOT NULL,
unique_id VARCHAR2(50),
da_scodare NUMBER(1,0) DEFAULT 0 NOT NULL,
id_richiesta VARCHAR2(23) NOT NULL,
stato NUMBER(2,0) NOT NULL,
data_transizione DATE NOT NULL,
msisdn VARCHAR2(15) NOT NULL,
data_cut_over DATE NOT NULL,
dataricezionerichiesta DATE NOT NULL,
codice_operatore_donating VARCHAR2(4) NOT NULL,
codice_operatore_recipient VARCHAR2(4) NOT NULL,
data_invio DATE,
data_creazione TIMESTAMP(6) NOT NULL
)
TABLESPACE TAB_HUGE_2;
ALTER TABLE mnp_dbcgo_notifica_porting_out
ADD CONSTRAINT pk_dbcgo_notifica_port_out PRIMARY KEY (id_prog)
USING INDEX
TABLESPACE TAB_IDX_HUGE_2_2;
CREATE INDEX idx_dbcgo_notifica_port_out_2
ON mnp_dbcgo_notifica_porting_out (id_richiesta)
TABLESPACE TAB_IDX_HUGE_2_2;
CREATE INDEX mnp_dbcgo_notifica_port_out_3
ON mnp_dbcgo_notifica_porting_out (unique_id)
TABLESPACE TAB_IDX_HUGE_2_2;
---------------------------------------------------------------

View File

@@ -0,0 +1,85 @@
-- eseguire come utente MNP
-------------------------------------------------------------------------
update mnp_dbcgo_notifica_donor_out o
SET o.codice_operatore_donating = (
select g.codice_operatore_donating
FROM mnp_gestione_richiesta g
where o.id_richiesta=g.id_richiesta );
ALTER TABLE mnp_dbcgo_notifica_donor_out
MODIFY (codice_operatore_donating NOT NULL);
-------------------------------------------------------------------------
update mnp_dbcgo_notifica_rec_out o
SET o.codice_operatore_recipient = 'TIMG';
ALTER TABLE mnp_dbcgo_notifica_rec_out
MODIFY (codice_operatore_recipient NOT NULL);
-------------------------------------------------------------------------
-- inserimento nuove funzionalità per DBCGO
insert into MNP_FUNZIONALITA_GUI(ID_PROG, FUNZIONALITA, COMANDO_FUNZ, JSP_NAME, CODICE_DOMINIO) values (37,'DBCGO Visualizzazione Ping Pong','DBCGO_PP_VIEW','DBCGO','GO');
-- inserimento associazione profili - funzionalità per DBCGO
insert into MNP_PROFILI_FUNZIONALITA(CODICE_PROFILO, ID_PROG) values ('GD',37);
insert into MNP_PROFILI_FUNZIONALITA(CODICE_PROFILO, ID_PROG) values ('GG',37);
insert into MNP_PROFILI_FUNZIONALITA(CODICE_PROFILO, ID_PROG) values ('GV',37);
insert into MNP_PROFILI_FUNZIONALITA(CODICE_PROFILO, ID_PROG) values ('VI',37);
-- inserimento liste di valori
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'PROCESS', 'D', 'DONOR');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'PROCESS', 'R', 'RECIPIENT');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'PROCESS', 'P', 'PORTING TERZE PARTI');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'PROCESS', 'C', 'CESSAZIONE');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'PROCESS', 'K', 'CESSAZIONE PORTING');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'XML_FILE_TYPE', '1', 'ATTIVAZIONE');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'XML_FILE_TYPE', '2', 'VALIDAZIONE');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'XML_FILE_TYPE', '3', 'PORTING');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'XML_FILE_TYPE', '4', 'ANNULLAMENTO');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'XML_FILE_TYPE', '5', 'PRESAINCARICO');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'XML_FILE_TYPE', '6', 'ESPLETAMENTO');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'XML_FILE_TYPE', '7', 'CESSAZIONE');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'XML_FILE_TYPE', '8', 'ACK');
Insert into MNP_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'XML_FILE_TYPE', '9', 'ATTIVAZIONE_HOC');
insert into MNP_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='1';
insert into MNP_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='2';
insert into MNP_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='3';
insert into MNP_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='5';
insert into MNP_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='6';
insert into MNP_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='7';
insert into MNP_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='9';
update MNP_LOV_REF set lov_id_ref = (select lov_id from MNP_LOV where lov_name='PROCESS' and name='D') where lov_id=(select lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='1') ;
update MNP_LOV_REF set lov_id_ref = (select lov_id from MNP_LOV where lov_name='PROCESS' and name='D') where lov_id=(select lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='9') ;
update MNP_LOV_REF set lov_id_ref = (select lov_id from MNP_LOV where lov_name='PROCESS' and name='R') where lov_id=(select lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='2') ;
update MNP_LOV_REF set lov_id_ref = (select lov_id from MNP_LOV where lov_name='PROCESS' and name='R') where lov_id=(select lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='5') ;
update MNP_LOV_REF set lov_id_ref = (select lov_id from MNP_LOV where lov_name='PROCESS' and name='R') where lov_id=(select lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='6') ;
update MNP_LOV_REF set lov_id_ref = (select lov_id from MNP_LOV where lov_name='PROCESS' and name='P') where lov_id=(select lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='3') ;
update MNP_LOV_REF set lov_id_ref = (select lov_id from MNP_LOV where lov_name='PROCESS' and name='C') where lov_id=(select lov_id from MNP_LOV where lov_name='XML_FILE_TYPE' and name='7') ;
-------------------------------------------------------------------------
------------- LOG
-- Log CrontabReportFtpTransfert
INSERT INTO mnp_anagrafica_processo (CODICE_PROCESSO,NOME_PROCESSO) VALUES ('ES','CrontabReportFtpTransfert');
INSERT INTO mnp_anagrafica_log (CODICE_LOG,SEVERITA,DESCRIZIONE) VALUES ('2700','C','ERRORE DURANTE IL BACKUP DEI REPORT LOCALI');
INSERT INTO mnp_anagrafica_log (CODICE_LOG,SEVERITA,DESCRIZIONE) VALUES ('2701','C','ERRORE DURANTE IL TRASFERIMENTO DEI REPORT');
INSERT INTO mnp_anagrafica_log (CODICE_LOG,SEVERITA,DESCRIZIONE) VALUES ('2702','W','FILE NON TRASFERITO ');
INSERT INTO mnp_processo_log (CODICE_PROCESSO,CODICE_LOG,LOG_ON) select 'ES',CODICE_LOG,1 from mnp_anagrafica_log where codice_log like '00%';
INSERT INTO mnp_processo_log (CODICE_PROCESSO,CODICE_LOG,LOG_ON) select 'ES',CODICE_LOG,1 from mnp_anagrafica_log where codice_log like '27%';
INSERT INTO mnp_processo_log (CODICE_PROCESSO,CODICE_LOG,LOG_ON) values('ES','9999',1);
delete from mnp_processo_log where codice_log in ('2502','2503');
delete from mnp_anagrafica_log where codice_log in ('2502','2503');
-------------------------------------------------------------------------
commit;
-------------------------------------------------------------------------

View File

@@ -0,0 +1,21 @@
-- Soluzione anomalia SM_1580
----------------------------------------------------------
CREATE INDEX idx15_dbcgo_gestione_richiesta
ON dbcgo_gestione_richiesta(data_transizione_stato)
NOLOGGING
TABLESPACE dbcgo_idx_big;
CREATE INDEX idx16_dbcgo_gestione_richiesta
ON dbcgo_gestione_richiesta(data_transizione_stato_grp)
NOLOGGING
TABLESPACE dbcgo_idx_big;
CREATE INDEX idx15_dbcgo_gestione_ric_rec
ON dbcgo_gestione_richiesta_rec(data_transizione_stato)
NOLOGGING
TABLESPACE dbcgo_idx_big;
CREATE INDEX idx16_dbcgo_gestione_ric_rec
ON dbcgo_gestione_richiesta_rec(data_transizione_stato_grp)
NOLOGGING
TABLESPACE dbcgo_idx_big;

View File

@@ -0,0 +1,29 @@
--execute as DBCGO
spool /mnpapp/log/script/dbcgo200604.log;
-----------------------------
--CREATE/MODIFY OBJECT
@@dbcgoDDL.sql
-----------------------------
--INSERT/UPDATE DATA
@@dbcgoDML.sql
-----------------------------
-- PING PONG DATA
@@infasa_pp.sql
-----------------------------
--COMPILE PROCEDURE
@/mnpapp/dbcgo/script/procedure/dbcgo/Util.jsp
show err
@/mnpapp/dbcgo/script/procedure/dbcgo/DWHT.pkg
show err
spool off;

View File

@@ -0,0 +1,261 @@
--da eseguire come utente DBCGO
-----------------------------------------------------------
--DB LINK
CREATE DATABASE LINK mnp
CONNECT TO mnp
IDENTIFIED BY "MNP"
USING 'MNP';
-----------------------------------------------------------
--DIRECTORY
CREATE OR REPLACE DIRECTORY dbcgo_dwht_path AS '/mnpapp/dbcgo/flussi/dwht';
-----------------------------------------------------------
--TABLE
ALTER TABLE dbcgo_gestione_richiesta
ADD (data_transizione_stato_grp DATE,
codice_operatore_donating VARCHAR2(4));
CREATE BITMAP INDEX idx14_dbcgo_gestione_ric
ON dbcgo_gestione_richiesta(codice_pre_post_pagato)
TABLESPACE dbcgo_idx_big;
-----------------------------------------------------------
ALTER TABLE dbcgo_gestione_richiesta_rec
ADD (data_transizione_stato_grp DATE,
codice_dealer VARCHAR2(10),
valore_cliente VARCHAR2(40) DEFAULT 'ND' NOT NULL,
valore_spesa VARCHAR2(40) DEFAULT 'ND' NOT NULL,
codice_operatore_recipient VARCHAR2(4),
codice_gruppo VARCHAR2(12));
CREATE BITMAP INDEX idx12_dbcgo_gestione_ric_rec
ON dbcgo_gestione_richiesta_rec(valore_cliente)
TABLESPACE dbcgo_idx_big;
CREATE BITMAP INDEX idx13_dbcgo_gestione_ric_rec
ON dbcgo_gestione_richiesta_rec(valore_spesa)
TABLESPACE dbcgo_idx_big;
CREATE BITMAP INDEX idx14_dbcgo_gestione_ric_rec
ON dbcgo_gestione_richiesta_rec(codice_pre_post_pagato)
TABLESPACE dbcgo_idx_big;
-----------------------------------------------------------
ALTER TABLE dbcgo_stato
ADD (stato_type NUMBER(1,0) DEFAULT 0 NOT NULL);
-----------------------------------------------------------
ALTER TABLE dbcgo_stato_rec
ADD (stato_type NUMBER(1,0) DEFAULT 0 NOT NULL);
-----------------------------------------------------------
CREATE TABLE dbcgo_gestione_richiesta_por
(
id_richiesta VARCHAR2(23 BYTE) NOT NULL,
stato NUMBER(2) NOT NULL,
dataricezionerichiesta DATE NOT NULL,
data_cut_over DATE,
codice_operatore_donating VARCHAR2(4 BYTE) NOT NULL,
codice_operatore_recipient VARCHAR2(4 BYTE) NOT NULL,
msisdn VARCHAR2(15 BYTE) NOT NULL,
insert_date DATE,
update_date DATE,
TIMESTAMP TIMESTAMP(6) NOT NULL,
data_transizione_stato DATE NOT NULL
)
TABLESPACE dbcgo_data_big;
CREATE UNIQUE INDEX pk_dbcgo_gest_rich_por
ON dbcgo_gestione_richiesta_por (id_richiesta)
TABLESPACE dbcgo_idx_big;
ALTER TABLE dbcgo_gestione_richiesta_por
ADD CONSTRAINT pk_dbcgo_gest_rich_por PRIMARY KEY (id_richiesta)
USING INDEX
TABLESPACE dbcgo_idx_big;
CREATE INDEX idx01_dbcgo_gestione_ric_por
ON dbcgo_gestione_richiesta_por (msisdn)
TABLESPACE dbcgo_idx_big;
-------------------------------------------------------------------------
CREATE TABLE SAP_ANAG_FV
(
COD_ID VARCHAR2(10) NOT NULL,
COD_ID_PADRE VARCHAR2(10) NOT NULL,
MERCATO VARCHAR2(4) NOT NULL,
DISLOCAZIONE_TERR VARCHAR2(4),
STATO NUMBER(1) NOT NULL,
DEALER_TYPE NUMBER(1) DEFAULT 0 NOT NULL
)
TABLESPACE DBCGO_DATA_BIG;
ALTER TABLE SAP_ANAG_FV
ADD CONSTRAINT SAP_ANAG_FV_PK
PRIMARY KEY (COD_ID)
USING INDEX
TABLESPACE DBCGO_IDX_BIG;
COMMENT ON COLUMN SAP_ANAG_FV.STATO IS '1 = dealer attivo, 0 = dealer non attivo';
COMMENT ON COLUMN SAP_ANAG_FV.DEALER_TYPE IS '1 = dealer fittizio, 0 = dealer non fittizio';
-------------------------------------------------------------------------
CREATE TABLE DBCGO_LOV_REF
(
LOV_ID NUMBER NOT NULL,
LOV_ID_REF NUMBER NOT NULL
)
TABLESPACE DBCGO_DATA_SMALL;
ALTER TABLE DBCGO_LOV_REF ADD
CONSTRAINT PK_DBCGO_LOV_REF
PRIMARY KEY (LOV_ID,LOV_ID_REF)
USING INDEX
TABLESPACE DBCGO_IDX_SMALL
ENABLE
VALIDATE;
ALTER TABLE DBCGO_LOV_REF
ADD CONSTRAINT FK0_DBCGO_LOV_REF
FOREIGN KEY (LOV_ID)
REFERENCES DBCGO_LOV (LOV_ID)
ENABLE
VALIDATE;
ALTER TABLE DBCGO_LOV_REF
ADD CONSTRAINT FK1_DBCGO_LOV_REF
FOREIGN KEY (LOV_ID_REF)
REFERENCES DBCGO_LOV (LOV_ID)
ENABLE
VALIDATE;
-------------------------------------------------------------------------
CREATE TABLE DWHT_VOLUMI_AOM0
(
MSISDN VARCHAR(40) NOT NULL,
CODICE_OPERATORE VARCHAR(6) NOT NULL,
NC NUMBER NOT NULL,
DC NUMBER NOT NULL
)
TABLESPACE DBCGO_DATA_BIG;
ALTER TABLE DWHT_VOLUMI_AOM0 ADD
CONSTRAINT DWHT_VOLUMI_AOM0_PK
PRIMARY KEY (MSISDN)
USING INDEX
TABLESPACE DBCGO_IDX_BIG;
-------------------------------------------------------------------------
CREATE TABLE DWHT_VOLUMI_AOM1
(
MSISDN VARCHAR(40) NOT NULL,
CODICE_OPERATORE VARCHAR(6) NOT NULL,
NC NUMBER NOT NULL,
DC NUMBER NOT NULL
)
TABLESPACE DBCGO_DATA_BIG;
ALTER TABLE DWHT_VOLUMI_AOM1 ADD
CONSTRAINT DWHT_VOLUMI_AOM1_PK
PRIMARY KEY (MSISDN)
USING INDEX
TABLESPACE DBCGO_IDX_BIG;
-------------------------------------------------------------------------
CREATE TABLE EXT_DWHT_VOLUMI_AOM
(
MSISDN VARCHAR(40),
CODICE_OPERATORE VARCHAR(6),
NC NUMBER,
DC NUMBER
)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY DBCGO_DWHT_PATH
ACCESS PARAMETERS
( RECORDS DELIMITED BY NEWLINE
BADFILE 'ext_dwht_volumi_aom.bad'
LOGFILE 'ext_dwht_volumi_aom.log'
FIELDS TERMINATED BY ';'
)
LOCATION (DBCGO_DWHT_PATH:'DWHT_VOLUMI_AOM.DAT')
)
REJECT LIMIT UNLIMITED
NOLOGGING
NOCACHE
NOPARALLEL;
-------------------------------------------------------------------------
CREATE TABLE DBCGO_STATO_POR
(
ID_STATO NUMBER(5) NOT NULL,
DESCR_STATO VARCHAR2(40 BYTE) NOT NULL,
ID_STATO_GRP NUMBER(5),
DESCR VARCHAR2(40 BYTE),
STATO_TYPE NUMBER(1,0) DEFAULT 0 NOT NULL
)
TABLESPACE DBCGO_DATA_SMALL;
-------------------------------------------------------------------------
CREATE TABLE dbcgo_pp
(
id_richiesta VARCHAR2(23) NOT NULL,
data_operazione DATE,
codice_operatore_donating VARCHAR2(4) NOT NULL,
codice_operatore_recipient VARCHAR2(4) NOT NULL,
msisdn VARCHAR2(15) NOT NULL,
processo VARCHAR2(1) NOT NULL,
terminato NUMBER(1,0) NOT NULL
)
TABLESPACE DBCGO_DATA_BIG;
ALTER TABLE dbcgo_pp
ADD CONSTRAINT pk_dbcgo_ping_pong PRIMARY KEY (id_richiesta,processo)
USING INDEX
TABLESPACE DBCGO_IDX_BIG;
CREATE INDEX idx01_dbcgo_ping_pong
ON dbcgo_pp (MSISDN)
TABLESPACE DBCGO_IDX_BIG;
CREATE INDEX idx02_dbcgo_ping_pong
ON dbcgo_pp (id_richiesta)
TABLESPACE DBCGO_IDX_BIG;
-------------------------------------------------------------------------
--VIEW
CREATE OR REPLACE VIEW DBCGO_PP_VIEW (
id_richiesta,msisdn,processo,codice_operatore_donating,codice_operatore_recipient,data_operazione )
AS
(
select id_richiesta,msisdn,'D' as processo,codice_operatore_donating,codice_operatore_recipient,data_transizione_stato as data_operazione
from DBCGO_GESTIONE_RICHIESTA
where stato=16 -- stato finale
UNION
select id_richiesta,msisdn,'R' as processo,codice_operatore_donating,codice_operatore_recipient,data_transizione_stato as data_operazione
from DBCGO_GESTIONE_RICHIESTA_REC
where stato=12 -- stato finale
UNION
select id_richiesta,msisdn,'P' as processo,codice_operatore_donating,codice_operatore_recipient,data_transizione_stato as data_operazione
from DBCGO_GESTIONE_RICHIESTA_POR
where stato=6 -- stato finale
);
-------------------------------------------------------------------------
--SYNONYM
CREATE SYNONYM DWHT_VOLUMI_AOM FOR DWHT_VOLUMI_AOM0;
-------------------------------------------------------------------------

View File

@@ -0,0 +1,544 @@
--da eseguire come utente DBCGO
-------------------------------------------------------------------------
update DBCGO_GESTIONE_RICHIESTA
set DATA_TRANSIZIONE_STATO_GRP = DATA_TRANSIZIONE_STATO;
alter table DBCGO_GESTIONE_RICHIESTA
modify (DATA_TRANSIZIONE_STATO_GRP NOT NULL);
update DBCGO_GESTIONE_RICHIESTA o
SET o.codice_operatore_donating = (
select g.codice_operatore_donating
FROM mnp_gestione_richiesta@MNP g
where o.id_richiesta=g.id_richiesta );
alter table DBCGO_GESTIONE_RICHIESTA
modify (CODICE_OPERATORE_DONATING NOT NULL);
-------------------------------------------------------------------------
update DBCGO_GESTIONE_RICHIESTA_REC
set DATA_TRANSIZIONE_STATO_GRP = DATA_TRANSIZIONE_STATO;
alter table DBCGO_GESTIONE_RICHIESTA_REC
modify (DATA_TRANSIZIONE_STATO_GRP NOT NULL);
update DBCGO_GESTIONE_RICHIESTA_REC o
SET (o.codice_operatore_recipient,o.codice_gruppo) = (
select g.codice_operatore_recipient,g.codice_gruppo
FROM mnp_gestione_richiesta_rec@MNP g
where o.id_richiesta=g.id_richiesta );
alter table DBCGO_GESTIONE_RICHIESTA_REC
modify (CODICE_OPERATORE_RECIPIENT NOT NULL);
-------------------------------------------------------------------------
--DBCGO_STATO
update dbcgo_stato set stato_type=1 --finale positivo
where id_stato in (16);
update dbcgo_stato set stato_type=2 --finale negativo
where id_stato in (4,10,12,22);
-------------------------------------------------------------------------
update dbcgo_stato_rec set stato_type=1 --finale positivo
where id_stato in (12);
update dbcgo_stato_rec set stato_type=2 --finale negativo
where id_stato in (1,5,7,9,14,17,16);
-------------------------------------------------------------------------
INSERT INTO DBCGO_STATO_POR ( ID_STATO, DESCR_STATO, ID_STATO_GRP, DESCR, STATO_TYPE ) VALUES (1, 'ACQUISITA', 1, 'ACQUISITA',0);
INSERT INTO DBCGO_STATO_POR ( ID_STATO, DESCR_STATO, ID_STATO_GRP, DESCR, STATO_TYPE ) VALUES (2, 'SCARTATA', 2, 'SCARTATA',2);
INSERT INTO DBCGO_STATO_POR ( ID_STATO, DESCR_STATO, ID_STATO_GRP, DESCR, STATO_TYPE ) VALUES (3, 'ATTESA_EVASIONE', 3, 'ATTESA_EVASIONE',0);
INSERT INTO DBCGO_STATO_POR ( ID_STATO, DESCR_STATO, ID_STATO_GRP, DESCR, STATO_TYPE ) VALUES (4, 'EVASA', 4, 'EVASA',0);
INSERT INTO DBCGO_STATO_POR ( ID_STATO, DESCR_STATO, ID_STATO_GRP, DESCR, STATO_TYPE ) VALUES (5, 'NON_EVASA', 5, 'NON_EVASA',0);
INSERT INTO DBCGO_STATO_POR ( ID_STATO, DESCR_STATO, ID_STATO_GRP, DESCR, STATO_TYPE ) VALUES (6, 'ESPLETATA', 6, 'ESPLETATA',1);
INSERT INTO DBCGO_STATO_POR ( ID_STATO, DESCR_STATO, ID_STATO_GRP, DESCR, STATO_TYPE ) VALUES (7, 'NON_EVASA_INVIATA', 7, 'NON_EVASA_INVIATA',0);
-----------------------------
--SAP_ANAG_FV - dealer fittizi
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('130','130','CUP','CUP',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('131','131','CUP','CUP',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('132','132','CUP','CUP',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('133','133','CUP','CUP',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('134','134','CUP','CUP',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('135','135','CUP','CUP',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('136','136','CUP','CUP',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('137','137','CUP','CUP',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('118','118','CCBU','CCBU',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('119','119','CCCO','CCCO',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('140','140','TS','TS',1,1);
insert into SAP_ANAG_FV(COD_ID, COD_ID_PADRE, MERCATO, DISLOCAZIONE_TERR, STATO, DEALER_TYPE) values ('141','141','TS','TS',1,1);
-------------------------------------------------------------------------
--DBCGO_LOV - PROCESS
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'PROCESS', 'D', 'DONOR');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'PROCESS', 'R', 'RECIPIENT');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'PROCESS', 'P', 'TERZA PARTE');
-------------------------------------------------------------------------
--DBCGO_LOV - OT_REC
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','C','CENTRO');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','CN','CENTRO NORD');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','LO','LOMBARDIA');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','NE','NORD EST');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','NO','NORD OVEST');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','S1','SUD 1');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','S2','SUD 2');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','N8VS','Grande Distrib. Org.');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','VEDG','Direz. Gen. Diffusivi');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','CUP','CUP');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','CCCO','CC CO');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','CCBU','CC BU');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','TS','TELESALES');
--DBCGO_LOV - OT_SAP
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CEVS', 'CEVS');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CNVS', 'CNVS');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'LOVS', 'LOVS');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'NEVS', 'NEVS');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'NOVS', 'NOVS');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'S1VS', 'S1VS');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'S2VS', 'S2VS');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'VEDG', 'VEDG');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'N8VS', 'N8VS');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CUP', 'CUP');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCCO', 'CC CO');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCBU', 'CC BU');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'TS', 'TELESALES');
--DBCGO_LOV - TIPO_CONTRATTO
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'TIPO_CONTRATTO', 'PRP', 'Prepagato');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'TIPO_CONTRATTO', 'POP', 'Abbonato');
--DBCGO_LOV - VALORE_CLIENTE
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'VALORE_CLIENTE', 'BASSO', 'Basso');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'VALORE_CLIENTE', 'MEDIO', 'Medio');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'VALORE_CLIENTE', 'ALTO', 'Alto');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'VALORE_CLIENTE', 'ND', 'Non Definito');
--DBCGO_LOV - VALORE_SPESA
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'VALORE_SPESA', 'BASSO_SP', 'Basso Spendente');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'VALORE_SPESA', 'MEDIO_SP', 'Medio Spendente');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'VALORE_SPESA', 'ALTO_SP', 'Alto Spendente');
Insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'VALORE_SPESA', 'ND', 'Non Definito');
--DBCGO_LOV - OT_SAP --> OT_REC
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CEVS';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CNVS';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='LOVS';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='NEVS';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='NOVS';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='S1VS';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='S2VS';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='VEDG';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='N8VS';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CUP';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CCCO';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CCBU';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='TS';
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='C') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CEVS') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='CN') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CNVS') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='LO') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='LOVS') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='NE') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='NEVS') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='NO') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='NOVS') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='S1') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='S1VS') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='S2') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='S2VS') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='VEDG') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='VEDG') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='N8VS') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='N8VS') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='CUP') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CUP') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='CCCO') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CCCO') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='CCBU') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='CCBU') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC' and name='TS') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP' and name='TS') ;
-------------------------------------------------------------------------
-------------------- INFASAMENTO PING PONG ------------------------------
---donor
insert into dbcgo_gestione_richiesta(
id_richiesta, stato, tipo_cliente, data_cut_over_calc,
data_validazione_max, dataricezionerichiesta, data_cut_over,
codicerifiutovalidazione, codice_operatore_recipient, msisdn,
codice_fiscale_partita_iva, codice_pre_post_pagato, nome_cliente,
cognome_cliente, ragione_sociale, richiestaadhocaom,
richiestaadhoc, marcaggio, sottomarcaggio, id_priorita,
insert_date, update_date, codice_gruppo, iccd_serial_number,
imsi, ipotesi_rifiuto, numero_documento, tipo_documento,
timestamp, data_transizione_stato, nome_ot_geo, nome_ot_leg,
id_priorita_mnp, data_transizione_stato_grp,
codice_operatore_donating)
SELECT a.id_richiesta, a.stato, a.tipo_cliente, a.data_cut_over_calc,
a.data_validazione_max, a.dataricezionerichiesta, a.data_cut_over,
a.codicerifiutovalidazione, a.codice_operatore_recipient, a.msisdn,
a.codice_fiscale_partita_iva, a.codice_pre_post_pagato, a.nome_cliente,
a.cognome_cliente, a.ragione_sociale, a.richiestaadhocaom,
a.richiestaadhoc, a.marcaggio, a.sottomarcaggio, 0,
SYSDATE, SYSDATE, a.codice_gruppo, a.iccd_serial_number,
a.imsi, a.ipotesi_rifiuto, a.numero_documento, a.tipo_documento,
SYSTIMESTAMP, b.data_lavorazione, '', a.nome_ot,
0, b.data_lavorazione,
a.codice_operatore_donating
FROM mnp_gestione_richiesta@mnp a, mnp_storico_richiesta@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=16 and b.stato_a=16
and a.dataricezionerichiesta >= to_date('01-01-2004','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-06-2004','dd-mm-yyyy')
and a.data_cut_over_calc >= to_date('01-01-2004','dd-mm-yyyy')
and a.id_richiesta not in (
select id_richiesta
from dbcgo_gestione_richiesta c
where c.id_richiesta=a.id_richiesta
)
/
commit
/
insert into dbcgo_gestione_richiesta(
id_richiesta, stato, tipo_cliente, data_cut_over_calc,
data_validazione_max, dataricezionerichiesta, data_cut_over,
codicerifiutovalidazione, codice_operatore_recipient, msisdn,
codice_fiscale_partita_iva, codice_pre_post_pagato, nome_cliente,
cognome_cliente, ragione_sociale, richiestaadhocaom,
richiestaadhoc, marcaggio, sottomarcaggio, id_priorita,
insert_date, update_date, codice_gruppo, iccd_serial_number,
imsi, ipotesi_rifiuto, numero_documento, tipo_documento,
timestamp, data_transizione_stato, nome_ot_geo, nome_ot_leg,
id_priorita_mnp, data_transizione_stato_grp,
codice_operatore_donating)
SELECT a.id_richiesta, a.stato, a.tipo_cliente, a.data_cut_over_calc,
a.data_validazione_max, a.dataricezionerichiesta, a.data_cut_over,
a.codicerifiutovalidazione, a.codice_operatore_recipient, a.msisdn,
a.codice_fiscale_partita_iva, a.codice_pre_post_pagato, a.nome_cliente,
a.cognome_cliente, a.ragione_sociale, a.richiestaadhocaom,
a.richiestaadhoc, a.marcaggio, a.sottomarcaggio, 0,
SYSDATE, SYSDATE, a.codice_gruppo, a.iccd_serial_number,
a.imsi, a.ipotesi_rifiuto, a.numero_documento, a.tipo_documento,
SYSTIMESTAMP, b.data_lavorazione, '', a.nome_ot,
0, b.data_lavorazione,
a.codice_operatore_donating
FROM mnp_gestione_richiesta@mnp a, mnp_storico_richiesta@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=16 and b.stato_a=16
and a.dataricezionerichiesta >= to_date('01-06-2004','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-01-2005','dd-mm-yyyy')
and a.data_cut_over_calc >= to_date('01-06-2004','dd-mm-yyyy')
and a.id_richiesta not in (
select id_richiesta
from dbcgo_gestione_richiesta c
where c.id_richiesta=a.id_richiesta
)
/
commit
/
insert into dbcgo_gestione_richiesta(
id_richiesta, stato, tipo_cliente, data_cut_over_calc,
data_validazione_max, dataricezionerichiesta, data_cut_over,
codicerifiutovalidazione, codice_operatore_recipient, msisdn,
codice_fiscale_partita_iva, codice_pre_post_pagato, nome_cliente,
cognome_cliente, ragione_sociale, richiestaadhocaom,
richiestaadhoc, marcaggio, sottomarcaggio, id_priorita,
insert_date, update_date, codice_gruppo, iccd_serial_number,
imsi, ipotesi_rifiuto, numero_documento, tipo_documento,
timestamp, data_transizione_stato, nome_ot_geo, nome_ot_leg,
id_priorita_mnp, data_transizione_stato_grp,
codice_operatore_donating)
SELECT a.id_richiesta, a.stato, a.tipo_cliente, a.data_cut_over_calc,
a.data_validazione_max, a.dataricezionerichiesta, a.data_cut_over,
a.codicerifiutovalidazione, a.codice_operatore_recipient, a.msisdn,
a.codice_fiscale_partita_iva, a.codice_pre_post_pagato, a.nome_cliente,
a.cognome_cliente, a.ragione_sociale, a.richiestaadhocaom,
a.richiestaadhoc, a.marcaggio, a.sottomarcaggio, 0,
SYSDATE, SYSDATE, a.codice_gruppo, a.iccd_serial_number,
a.imsi, a.ipotesi_rifiuto, a.numero_documento, a.tipo_documento,
SYSTIMESTAMP, b.data_lavorazione, '', a.nome_ot,
0, b.data_lavorazione,
a.codice_operatore_donating
FROM mnp_gestione_richiesta@mnp a, mnp_storico_richiesta@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=16 and b.stato_a=16
and a.dataricezionerichiesta >= to_date('01-01-2005','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-06-2005','dd-mm-yyyy')
and a.data_cut_over_calc >= to_date('01-01-2005','dd-mm-yyyy')
and a.id_richiesta not in (
select id_richiesta
from dbcgo_gestione_richiesta c
where c.id_richiesta=a.id_richiesta
)
/
commit
/
insert into dbcgo_gestione_richiesta(
id_richiesta, stato, tipo_cliente, data_cut_over_calc,
data_validazione_max, dataricezionerichiesta, data_cut_over,
codicerifiutovalidazione, codice_operatore_recipient, msisdn,
codice_fiscale_partita_iva, codice_pre_post_pagato, nome_cliente,
cognome_cliente, ragione_sociale, richiestaadhocaom,
richiestaadhoc, marcaggio, sottomarcaggio, id_priorita,
insert_date, update_date, codice_gruppo, iccd_serial_number,
imsi, ipotesi_rifiuto, numero_documento, tipo_documento,
timestamp, data_transizione_stato, nome_ot_geo, nome_ot_leg,
id_priorita_mnp, data_transizione_stato_grp,
codice_operatore_donating)
SELECT a.id_richiesta, a.stato, a.tipo_cliente, a.data_cut_over_calc,
a.data_validazione_max, a.dataricezionerichiesta, a.data_cut_over,
a.codicerifiutovalidazione, a.codice_operatore_recipient, a.msisdn,
a.codice_fiscale_partita_iva, a.codice_pre_post_pagato, a.nome_cliente,
a.cognome_cliente, a.ragione_sociale, a.richiestaadhocaom,
a.richiestaadhoc, a.marcaggio, a.sottomarcaggio, 0,
SYSDATE, SYSDATE, a.codice_gruppo, a.iccd_serial_number,
a.imsi, a.ipotesi_rifiuto, a.numero_documento, a.tipo_documento,
SYSTIMESTAMP, b.data_lavorazione, '', a.nome_ot,
0, b.data_lavorazione,
a.codice_operatore_donating
FROM mnp_gestione_richiesta@mnp a, mnp_storico_richiesta@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=16 and b.stato_a=16
and a.dataricezionerichiesta >= to_date('01-06-2005','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-01-2006','dd-mm-yyyy')
and a.data_cut_over_calc >= to_date('01-06-2005','dd-mm-yyyy')
and a.id_richiesta not in (
select id_richiesta
from dbcgo_gestione_richiesta c
where c.id_richiesta=a.id_richiesta
)
/
commit
/
------ recipient
insert into dbcgo_gestione_richiesta_rec(
id_richiesta, stato, tipo_cliente, data_cut_over_calc,
data_validazione_max, dataricezionerichiesta, data_cut_over,
codice_operatore_donating, msisdn, codice_fiscale_partita_iva,
codice_pre_post_pagato, nome_cliente, cognome_cliente,
ragione_sociale, causale_accodamento, richiestaadhoc,
richiestaadhocaom, id_priorita, insert_date, update_date,
iccd_serial_number, imsi, nome_ot, numero_documento,
tipo_documento, numero_invii, timestamp, data_transizione_stato,
id_priorita_mnp, data_transizione_stato_grp,
codice_operatore_recipient, codice_gruppo, codice_dealer,
valore_cliente, valore_spesa)
SELECT a.id_richiesta, a.stato, a.tipo_cliente, a.data_cut_over_calc,
a.data_validazione_max, a.dataricezionerichiesta, a.data_cut_over,
a.codice_operatore_donating, a.msisdn, a.codice_fiscale_partita_iva,
a.codice_pre_post_pagato, a.nome_cliente, a.cognome_cliente,
a.ragione_sociale, a.causale_accodamento, a.richiestaadhoc,
a.richiestaadhocaom, 0, sysdate, sysdate,
a.iccid_serial_number, a.imsi, a.nome_ot, a.numero_documento,
a.tipo_documento, a.numero_invii, SYSTIMESTAMP, b.data_lavorazione,
0, b.data_lavorazione,
a.codice_operatore_recipient, a.codice_gruppo, '',
'ND', 'ND'
FROM mnp_gestione_richiesta_rec@mnp a,mnp_storico_richiesta_rec@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=12 and b.stato_a=12
and a.dataricezionerichiesta >= to_date('01-01-2004','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-06-2004','dd-mm-yyyy')
and a.data_cut_over_calc >= to_date('01-01-2004','dd-mm-yyyy')
and a.id_richiesta not in (
select id_richiesta
from dbcgo_gestione_richiesta_rec c
where c.id_richiesta=a.id_richiesta
)
/
commit
/
insert into dbcgo_gestione_richiesta_rec(
id_richiesta, stato, tipo_cliente, data_cut_over_calc,
data_validazione_max, dataricezionerichiesta, data_cut_over,
codice_operatore_donating, msisdn, codice_fiscale_partita_iva,
codice_pre_post_pagato, nome_cliente, cognome_cliente,
ragione_sociale, causale_accodamento, richiestaadhoc,
richiestaadhocaom, id_priorita, insert_date, update_date,
iccd_serial_number, imsi, nome_ot, numero_documento,
tipo_documento, numero_invii, timestamp, data_transizione_stato,
id_priorita_mnp, data_transizione_stato_grp,
codice_operatore_recipient, codice_gruppo, codice_dealer,
valore_cliente, valore_spesa)
SELECT a.id_richiesta, a.stato, a.tipo_cliente, a.data_cut_over_calc,
a.data_validazione_max, a.dataricezionerichiesta, a.data_cut_over,
a.codice_operatore_donating, a.msisdn, a.codice_fiscale_partita_iva,
a.codice_pre_post_pagato, a.nome_cliente, a.cognome_cliente,
a.ragione_sociale, a.causale_accodamento, a.richiestaadhoc,
a.richiestaadhocaom, 0, sysdate, sysdate,
a.iccid_serial_number, a.imsi, a.nome_ot, a.numero_documento,
a.tipo_documento, a.numero_invii, SYSTIMESTAMP, b.data_lavorazione,
0, b.data_lavorazione,
a.codice_operatore_recipient, a.codice_gruppo, '',
'ND', 'ND'
FROM mnp_gestione_richiesta_rec@mnp a,mnp_storico_richiesta_rec@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=12 and b.stato_a=12
and a.dataricezionerichiesta >= to_date('01-06-2004','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-01-2005','dd-mm-yyyy')
and a.data_cut_over_calc >= to_date('01-06-2004','dd-mm-yyyy')
and a.id_richiesta not in (
select id_richiesta
from dbcgo_gestione_richiesta_rec c
where c.id_richiesta=a.id_richiesta
)
/
commit
/
insert into dbcgo_gestione_richiesta_rec(
id_richiesta, stato, tipo_cliente, data_cut_over_calc,
data_validazione_max, dataricezionerichiesta, data_cut_over,
codice_operatore_donating, msisdn, codice_fiscale_partita_iva,
codice_pre_post_pagato, nome_cliente, cognome_cliente,
ragione_sociale, causale_accodamento, richiestaadhoc,
richiestaadhocaom, id_priorita, insert_date, update_date,
iccd_serial_number, imsi, nome_ot, numero_documento,
tipo_documento, numero_invii, timestamp, data_transizione_stato,
id_priorita_mnp, data_transizione_stato_grp,
codice_operatore_recipient, codice_gruppo, codice_dealer,
valore_cliente, valore_spesa)
SELECT a.id_richiesta, a.stato, a.tipo_cliente, a.data_cut_over_calc,
a.data_validazione_max, a.dataricezionerichiesta, a.data_cut_over,
a.codice_operatore_donating, a.msisdn, a.codice_fiscale_partita_iva,
a.codice_pre_post_pagato, a.nome_cliente, a.cognome_cliente,
a.ragione_sociale, a.causale_accodamento, a.richiestaadhoc,
a.richiestaadhocaom, 0, sysdate, sysdate,
a.iccid_serial_number, a.imsi, a.nome_ot, a.numero_documento,
a.tipo_documento, a.numero_invii, SYSTIMESTAMP, b.data_lavorazione,
0, b.data_lavorazione,
a.codice_operatore_recipient, a.codice_gruppo, '',
'ND', 'ND'
FROM mnp_gestione_richiesta_rec@mnp a,mnp_storico_richiesta_rec@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=12 and b.stato_a=12
and a.dataricezionerichiesta >= to_date('01-01-2005','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-06-2005','dd-mm-yyyy')
and a.data_cut_over_calc >= to_date('01-01-2005','dd-mm-yyyy')
and a.id_richiesta not in (
select id_richiesta
from dbcgo_gestione_richiesta_rec c
where c.id_richiesta=a.id_richiesta
)
/
commit
/
insert into dbcgo_gestione_richiesta_rec(
id_richiesta, stato, tipo_cliente, data_cut_over_calc,
data_validazione_max, dataricezionerichiesta, data_cut_over,
codice_operatore_donating, msisdn, codice_fiscale_partita_iva,
codice_pre_post_pagato, nome_cliente, cognome_cliente,
ragione_sociale, causale_accodamento, richiestaadhoc,
richiestaadhocaom, id_priorita, insert_date, update_date,
iccd_serial_number, imsi, nome_ot, numero_documento,
tipo_documento, numero_invii, timestamp, data_transizione_stato,
id_priorita_mnp, data_transizione_stato_grp,
codice_operatore_recipient, codice_gruppo, codice_dealer,
valore_cliente, valore_spesa)
SELECT a.id_richiesta, a.stato, a.tipo_cliente, a.data_cut_over_calc,
a.data_validazione_max, a.dataricezionerichiesta, a.data_cut_over,
a.codice_operatore_donating, a.msisdn, a.codice_fiscale_partita_iva,
a.codice_pre_post_pagato, a.nome_cliente, a.cognome_cliente,
a.ragione_sociale, a.causale_accodamento, a.richiestaadhoc,
a.richiestaadhocaom, 0, sysdate, sysdate,
a.iccid_serial_number, a.imsi, a.nome_ot, a.numero_documento,
a.tipo_documento, a.numero_invii, SYSTIMESTAMP, b.data_lavorazione,
0, b.data_lavorazione,
a.codice_operatore_recipient, a.codice_gruppo, '',
'ND', 'ND'
FROM mnp_gestione_richiesta_rec@mnp a,mnp_storico_richiesta_rec@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=12 and b.stato_a=12
and a.dataricezionerichiesta >= to_date('01-06-2005','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-01-2006','dd-mm-yyyy')
and a.data_cut_over_calc >= to_date('01-06-2005','dd-mm-yyyy')
and a.id_richiesta not in (
select id_richiesta
from dbcgo_gestione_richiesta_rec c
where c.id_richiesta=a.id_richiesta
)
/
commit
/
------ porting
insert into dbcgo_gestione_richiesta_por(
id_richiesta, stato, dataricezionerichiesta, data_cut_over,
codice_operatore_donating, codice_operatore_recipient, msisdn,
insert_date, update_date, timestamp, data_transizione_stato)
SELECT a.id_richiesta, a.stato, a.dataricezionerichiesta, a.data_cut_over,
a.codice_operatore_donating, a.codice_operatore_recipient, a.msisdn,
sysdate, sysdate, SYSTIMESTAMP, b.data_lavorazione
FROM mnp_gestione_richiesta_porting@mnp a,mnp_storico_porting@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=6 and b.stato_a=6
and a.dataricezionerichiesta >= to_date('01-01-2004','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-06-2004','dd-mm-yyyy')
/
commit
/
insert into dbcgo_gestione_richiesta_por(
id_richiesta, stato, dataricezionerichiesta, data_cut_over,
codice_operatore_donating, codice_operatore_recipient, msisdn,
insert_date, update_date, timestamp, data_transizione_stato)
SELECT a.id_richiesta, a.stato, a.dataricezionerichiesta, a.data_cut_over,
a.codice_operatore_donating, a.codice_operatore_recipient, a.msisdn,
sysdate, sysdate, SYSTIMESTAMP, b.data_lavorazione
FROM mnp_gestione_richiesta_porting@mnp a,mnp_storico_porting@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=6 and b.stato_a=6
and a.dataricezionerichiesta >= to_date('01-06-2004','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-01-2005','dd-mm-yyyy')
/
commit
/
insert into dbcgo_gestione_richiesta_por(
id_richiesta, stato, dataricezionerichiesta, data_cut_over,
codice_operatore_donating, codice_operatore_recipient, msisdn,
insert_date, update_date, timestamp, data_transizione_stato)
SELECT a.id_richiesta, a.stato, a.dataricezionerichiesta, a.data_cut_over,
a.codice_operatore_donating, a.codice_operatore_recipient, a.msisdn,
sysdate, sysdate, SYSTIMESTAMP, b.data_lavorazione
FROM mnp_gestione_richiesta_porting@mnp a,mnp_storico_porting@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=6 and b.stato_a=6
and a.dataricezionerichiesta >= to_date('01-01-2005','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-06-2005','dd-mm-yyyy')
/
commit
/
insert into dbcgo_gestione_richiesta_por(
id_richiesta, stato, dataricezionerichiesta, data_cut_over,
codice_operatore_donating, codice_operatore_recipient, msisdn,
insert_date, update_date, timestamp, data_transizione_stato)
SELECT a.id_richiesta, a.stato, a.dataricezionerichiesta, a.data_cut_over,
a.codice_operatore_donating, a.codice_operatore_recipient, a.msisdn,
sysdate, sysdate, SYSTIMESTAMP, b.data_lavorazione
FROM mnp_gestione_richiesta_porting@mnp a,mnp_storico_porting@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=6 and b.stato_a=6
and a.dataricezionerichiesta >= to_date('01-06-2005','dd-mm-yyyy')
and a.dataricezionerichiesta < to_date('01-01-2006','dd-mm-yyyy')
/
commit
/
insert into dbcgo_gestione_richiesta_por(
id_richiesta, stato, dataricezionerichiesta, data_cut_over,
codice_operatore_donating, codice_operatore_recipient, msisdn,
insert_date, update_date, timestamp, data_transizione_stato)
SELECT a.id_richiesta, a.stato, a.dataricezionerichiesta, a.data_cut_over,
a.codice_operatore_donating, a.codice_operatore_recipient, a.msisdn,
sysdate, sysdate, SYSTIMESTAMP, b.data_lavorazione
FROM mnp_gestione_richiesta_porting@mnp a,mnp_storico_porting@mnp b
where a.id_richiesta=b.id_richiesta
and a.stato=6 and b.stato_a=6
and a.dataricezionerichiesta >= to_date('01-01-2006','dd-mm-yyyy')
/
update dbcgo_gestione_richiesta
set nome_ot_leg='NN',nome_ot_geo='NN',marcaggio='01',sottomarcaggio='34'
where tipo_cliente='CO' and nome_ot_leg='ZZ'
/
commit;
-------------------------------------------------------------------------

View File

@@ -0,0 +1,48 @@
-- insert donor in stato attivo
insert into dbcgo_pp(id_richiesta, data_operazione, codice_operatore_donating,codice_operatore_recipient, msisdn, processo, terminato)
select id_richiesta,data_transizione_stato,codice_operatore_donating,codice_operatore_recipient,msisdn,'D',0
from DBCGO_GESTIONE_RICHIESTA d1
where stato not in (4,10,12,16,22)
and msisdn in (
SELECT msisdn FROM dbcgo_pp_view v where v.msisdn=d1.msisdn
)
/
commit;
-- insert recipient in stato attivo
insert into dbcgo_pp(id_richiesta, data_operazione, codice_operatore_donating,codice_operatore_recipient, msisdn, processo, terminato)
select id_richiesta,data_transizione_stato,codice_operatore_donating,codice_operatore_recipient,msisdn,'R',0
from DBCGO_GESTIONE_RICHIESTA_REC r1
where stato not in (1,5,7,9,12,14,16,17)
and msisdn in (
SELECT msisdn FROM dbcgo_pp_view v where v.msisdn=r1.msisdn
)
/
commit;
-- insert dbcgo_pp_view da stato attivo
insert into dbcgo_pp(id_richiesta, data_operazione, codice_operatore_donating,codice_operatore_recipient, msisdn, processo, terminato)
SELECT id_richiesta,data_operazione,codice_operatore_donating,codice_operatore_recipient,msisdn,processo,1
FROM dbcgo_pp_view v
where exists (
select 1
from dbcgo_pp p
where p.msisdn=v.msisdn
)
/
commit;
-- insert da dbcgo_view_pp con almeno 2 richieste e nessuna richiesta in stato attivo
insert into dbcgo_pp(id_richiesta, data_operazione, codice_operatore_donating,codice_operatore_recipient, msisdn, processo, terminato)
SELECT id_richiesta,data_operazione,codice_operatore_donating,codice_operatore_recipient,msisdn,processo,1
FROM dbcgo_pp_view v
where msisdn in (
select msisdn
from dbcgo_pp_view
group by msisdn
having count(msisdn)>1
)
and not exists(
select 1
from dbcgo_pp p
where p.msisdn=v.msisdn
)
/
commit;

View File

@@ -0,0 +1,8 @@
--da eseguire come utente SYSTEM
spool /mnpapp/log/script/system200604.log;
GRANT JAVAUSERPRIV TO DBCGO;
GRANT JAVASYSPRIV TO DBCGO;
spool off