--execute as DBCGO

-----UPDATE DBCGO_STATO PER VISUALIZZAZIONE POST-VALIDAZIONE
UPDATE DBCGO_STATO SET ID_STATO_GRP=9 WHERE ID_STATO=9;
UPDATE DBCGO_STATO SET ID_STATO_GRP=10 WHERE ID_STATO=10;
UPDATE DBCGO_STATO SET ID_STATO_GRP=14 WHERE ID_STATO=14;
UPDATE DBCGO_STATO SET ID_STATO_GRP=15 WHERE ID_STATO=15;
UPDATE DBCGO_STATO SET ID_STATO_GRP=16 WHERE ID_STATO=16;
UPDATE DBCGO_STATO SET ID_STATO_GRP=22 WHERE ID_STATO=22;
UPDATE DBCGO_STATO SET ID_STATO_GRP=99 WHERE ID_STATO=99;

---INSERT DBCGO_LOV PER XTENSION
INSERT INTO DBCGO_LOV (LOV_ID, LOV_NAME, NAME, DESCR) 
		VALUES ( SEQ_LOV.NEXTVAL,'SIST_MITTENTE','MSP_EXT','SIMBA');
INSERT INTO DBCGO_LOV (LOV_ID, LOV_NAME, NAME, DESCR) 
		VALUES ( SEQ_LOV.NEXTVAL,'TIPO_OPERAZIONE','XTE','XTE');
INSERT INTO DBCGO_LOV (LOV_ID, LOV_NAME, NAME, DESCR) 
		VALUES ( SEQ_LOV.NEXTVAL,'TIPO_OPERAZIONE','TAF','TAF');


--DBCGO_LOV_REF - Relazione tra Sistema Mittente e Tipo Cliente

insert into DBCGO_LOV_REF(lov_id, lov_id_ref) select lov_id,lov_id from DBCGO_LOV where lov_name='SIST_MITTENTE' and name='MSP_EXT';

update DBCGO_LOV_REF set lov_id_ref = (select lov_id from DBCGO_LOV where lov_name='CUST_TYPE'	and name='CO') where lov_id=(select lov_id from DBCGO_LOV where lov_name='SIST_MITTENTE'	and name='MSP_EXT') ;


COMMIT;