spool /mnpapp/dbcgo/log/script/RU_265.log;

----- Inizio DBCGO_LOV -----

--Inizio Nuovi OT_SAP
-- Centro
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PLCE', 'PLCE');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PHCE', 'PHCE');
-- ot sap fittizi
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCFI', 'CCFI');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCCE', 'CCCE');
-- Fine Centro

-- Centro Nord
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PLCN', 'PLCN');
-- ot sap fittizi
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCCN', 'CCCN');
-- Fine Centro

-- Nord Est
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PLNE', 'PLNE');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PHNE', 'PHNE');
-- ot sap fittizi
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCNE', 'CCNE');
-- Fine Nord Est

-- Nord Ovest
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PLNO', 'PLNO');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PHNO', 'PHNO');
-- ot sap fittizi
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCNO', 'CCNO');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCLO', 'CCLO');
-- Fine Nord Ovest

-- Sud
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PLSU', 'PLSU');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PHSU', 'PHSU');
-- ot sap fittizi
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCS1', 'CCS1');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCS2', 'CCS2');
-- Fine Sud

-- Direzione Generale
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PLDG', 'PLDG');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'OVDG', 'OVDG');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'PHDG', 'PHDG');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'CCDG', 'CCDG');

-- Grande Distrib. Org DG
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'GDDG', 'GDDG');

-- Grande Distrib. Spec. DG
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval, 'OT_SAP', 'GSDG', 'GSDG');

--Fine Nuovi OT_SAP

--Inizio Nuovi OT_REC
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','DG','Direzione Generale');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','GDDG','Grande Distrib. Org. DG');
insert into DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) Values (SEQ_LOV.nextval,'OT_REC','GSDG','Grande Distrib. Spec. DG');
--Fine Nuovi OT_REC

-- Update OT_REC 

-- Fine DBCGO_LOV 

--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='PLCE';
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='PHCE';
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='CCFI';
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='CCCE';
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='PLCN';
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='CCCN';
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='PLNE';
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='PHNE';
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='CCNE';
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='PLNO';
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='PHNO';
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='CCNO';
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='CCLO';
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='PLSU';
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='PHSU';
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='CCS1';
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='CCS2';
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='PLDG';
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='OVDG';
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='PHDG';
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='CCDG';
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='GDDG';
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='GSDG';


-- Centro
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='PLCE') ;
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='PHCE') ;
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='CCFI') ;
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='CCCE') ;

-- Centro Nord
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='PLCN') ;
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='CCCN') ;

-- Nord Est
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='PLNE') ;
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='PHNE') ;
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='CCNE') ;
	
-- Nord Ovest
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='PLNO') ;
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='PHNO') ;
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='CCNO') ;
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='CCLO') ;

-- Sud
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='SU') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='PLSU') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='SU') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='PHSU') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='SU') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='CCS1') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='SU') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='CCS2') ;

--Direzione Generale
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='DG') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='PLDG') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='DG') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='OVDG') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='DG') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='PHDG') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='DG') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='CCDG') ;

-- Grande Distrib. Org DG
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='GDDG') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='GDDG') ;

-- Grande Distrib. Spec. DG
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='OT_REC'	and name='GSDG') where lov_id=(select lov_id from DBCGO_LOV where lov_name='OT_SAP'	and name='GSDG') ;	


-------------------------------------------------------------------------
--DBCGO_LOV - filtro CANALE_ACQUISIZIONE

INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'CAN_ACQ', 'ESP', 'ESP');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'CAN_ACQ', 'BUSM', 'BUSM');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'CAN_ACQ', 'CCMO', 'CCMO');


INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2G','2G');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2E','2E');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2F','2F');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2B','2B');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2C','2C');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2R','2R');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2P','2P');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2Q','2Q');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2D','2D');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2S','2S');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','2A','2A'); 
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','19','19');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','1V','1V');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','1D','1D');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','1Q','1Q');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','10','10');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','11','11');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','12','12');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','1P','1P');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','13','13');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','14','14');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','15','15');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','16','16');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','18','18');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','1S','1S');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','1T','1T');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','1R','1R');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','1U','1U');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','CC','CC');
INSERT INTO DBCGO_LOV(LOV_ID, LOV_NAME, NAME, DESCR) VALUES (SEQ_LOV.nextval, 'SOTTOCAN_ACQ','CB','CB');


insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2G';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2E';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2F';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2B';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2C';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2R';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2P';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2Q';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2D';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2S';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='2A';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='19';                                                                                        
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='1V';                                                                                                                                                                               
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='1D';   
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='1Q';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='10';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='11';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='12';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='1P';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='13';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='14';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='15';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='16';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='18';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='1S';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='1T';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='1R';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='1U';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='CC';
insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ' and name='CB';
                                                                                                                          
                                                                                                                                                                                                                      
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2G') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='TD') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2E') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='TS') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2F') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2B') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='AS') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2C') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2R') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2P') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2Q') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2D') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2S') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='2A') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='CA') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='19') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='1V') ;        
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='1D') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='1Q') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='10') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='11') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='12') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='1P') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='13') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='14') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='15') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='16') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='18') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='1S') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='1T') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='1R') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='1U') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='CC') ;
update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ_GRP'	and name='0') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SOTTOCAN_ACQ'	and name='CB') ;

-- DEALER FITTIZZI

update SAP_ANAG_FV set CANALE_ACQUISIZIONE='PUSH',SOTTOCANALE_ACQUISIZIONE='2F',SEGMENTAZIONE_CANALE='2F' where cod_id='140'; 
update SAP_ANAG_FV set CANALE_ACQUISIZIONE='PUSH',SOTTOCANALE_ACQUISIZIONE='2F',SEGMENTAZIONE_CANALE='2F' where cod_id='141'; 
update SAP_ANAG_FV set CANALE_ACQUISIZIONE='PUSH',SOTTOCANALE_ACQUISIZIONE='2E',SEGMENTAZIONE_CANALE='2E' where cod_id='143'; 

commit
/
spool off;
exit
