INSERT INTO Q0266T00 ( RESUL_ID_066, RESUL_DENOC_066,
RESUL_DENOE_066 ) VALUES ( 
8, 'El fichero ya existe', '*El fichero ya existe'); 


/*tabla de compromiso convenio*/

DROP TABLE Q0258T00 CASCADE CONSTRAINTS ; 

CREATE TABLE Q0258T00 ( 
  CO_ID_058    VARCHAR2 (2)  NOT NULL, 
  CO_DESC_058  VARCHAR2 (50), 
  CO_DESE_058  VARCHAR2 (50), 
  CONSTRAINT PK_Q0258T00
  PRIMARY KEY ( CO_ID_058 ) 
    USING INDEX 
     TABLESPACE Q0202E00 PCTFREE 10
     STORAGE ( INITIAL 65536 ))
   TABLESPACE Q0201E00
   PCTFREE 10
   PCTUSED 40
   INITRANS 1
   MAXTRANS 255
  STORAGE ( 
   INITIAL 40960
   NEXT 40960
   PCTINCREASE 50
   MINEXTENTS 1
   MAXEXTENTS 505
   FREELISTS 1 FREELIST GROUPS 1 )
   NOCACHE; 

CREATE SYNONYM Q0258S00 FOR Q0258T00;
   
/*carga datos Q0258T00*/
INSERT INTO Q0258T00 ( CO_ID_058, CO_DESC_058, CO_DESE_058 ) VALUES ( 
'1', 'VPO', '*VPO'); 
INSERT INTO Q0258T00 ( CO_ID_058, CO_DESC_058, CO_DESE_058 ) VALUES ( 
'2', 'SOC', '*SOC'); 
INSERT INTO Q0258T00 ( CO_ID_058, CO_DESC_058, CO_DESE_058 ) VALUES ( 
'3', 'MIX', '*MIX'); 


/*tabla de proyecto vivienda*/

DROP TABLE Q0257T00 CASCADE CONSTRAINTS ; 

CREATE TABLE Q0257T00 ( 
  PV_ID_057    VARCHAR2 (2)  NOT NULL, 
  PV_DESC_057  VARCHAR2 (50), 
  PV_DESE_057  VARCHAR2 (50), 
  CONSTRAINT PK_Q0257T00
  PRIMARY KEY ( PV_ID_057 ) 
    USING INDEX 
     TABLESPACE Q0202E00 PCTFREE 10
     STORAGE ( INITIAL 65536 ))
   TABLESPACE Q0201E00
   PCTFREE 10
   PCTUSED 40
   INITRANS 1
   MAXTRANS 255
  STORAGE ( 
   INITIAL 40960
   NEXT 40960
   PCTINCREASE 50
   MINEXTENTS 1
   MAXEXTENTS 505
   FREELISTS 1 FREELIST GROUPS 1 )
   NOCACHE; 

CREATE SYNONYM Q0257S00 FOR Q0257T00; 

/*carga datos Q0257T00*/
INSERT INTO Q0257T00 ( PV_ID_057, PV_DESC_057, PV_DESE_057 ) VALUES ( 
'1', 'SI', '*SI'); 
INSERT INTO Q0257T00 ( PV_ID_057, PV_DESC_057, PV_DESE_057 ) VALUES ( 
'2', 'NO', '*NO'); 
INSERT INTO Q0257T00 ( PV_ID_057, PV_DESC_057, PV_DESE_057 ) VALUES ( 
'3', 'PB AYTO', '*PB AYTO'); 
INSERT INTO Q0257T00 ( PV_ID_057, PV_DESC_057, PV_DESE_057 ) VALUES ( 
'4', 'PE', '*PE'); 
INSERT INTO Q0257T00 ( PV_ID_057, PV_DESC_057, PV_DESE_057 ) VALUES ( 
'5', 'PB', '*PB'); 
INSERT INTO Q0257T00 ( PV_ID_057, PV_DESC_057, PV_DESE_057 ) VALUES ( 
'6', 'VISESA', '*VISESA'); 
INSERT INTO Q0257T00 ( PV_ID_057, PV_DESC_057, PV_DESE_057 ) VALUES ( 
'7', 'AYTO', '*AYTO'); 
INSERT INTO Q0257T00 ( PV_ID_057, PV_DESC_057, PV_DESE_057 ) VALUES ( 
'8', 'SIN', '*SIN'); 
INSERT INTO Q0257T00 ( PV_ID_057, PV_DESC_057, PV_DESE_057 ) VALUES ( 
'9', 'ARABARRI', '*ARABARRI'); 


/*columna de conpromiso convenio en tabla convenios e integridad referencial*/
ALTER TABLE Q0201T00 ADD ( 
  CO_ID_001 VARCHAR2(2) );

ALTER TABLE Q0201T00
 ADD CONSTRAINT FK_Q0258T00_01
 FOREIGN KEY (CO_ID_001)
 REFERENCES Q0258T00 (CO_ID_058);
 
 /*columna de proyecto vivienda en tabla convenios e integridad referencial*/
ALTER TABLE Q0201T00 ADD ( 
  PV_ID_001 VARCHAR2(2) );

ALTER TABLE Q0201T00
 ADD CONSTRAINT FK_Q0257T00_01
 FOREIGN KEY (PV_ID_001)
 REFERENCES Q0257T00 (PV_ID_057);
 
/*columna VISESA en tabla de elementos de convenios*/
ALTER TABLE Q0202T00 ADD ( 
  CCE_VISESA_002 NUMBER(1) );
  
  
/* Nuevo listado */
INSERT INTO Q0296T00 ( LIST_ID_096, LIST_ACT_096, LIST_PLANT_096, LIST_EVENT_096, LIST_DENOC_096,
LIST_DENOE_096, LIST_PLANTEXCEL_096 ) VALUES ( 
'ESTCM_00U', 1, 'listado_cmando.xsl', 'eLCM', 'U - Cuadro de mando', '*U - Cuadro de mando'
, 'listado_cmando.xslt'); 


/*Corrección de datos de promociones*/
UPDATE Q0208T00 SET PR_COD_008='EB1-0056/82-LE-000' WHERE PR_ID_008=5083;
UPDATE Q0208T00 SET PR_COD_008='EB3-8568/92-LE-000' WHERE PR_ID_008=5134;
UPDATE Q0208T00 SET PR_COD_008='EB2-1165/89-LE-000' WHERE PR_ID_008=5374;
UPDATE Q0208T00 SET PR_COD_008='EB2-0197/88-LE-000' WHERE PR_ID_008=5375;
UPDATE Q0208T00 SET PR_COD_008='EB2-1159/87-LE-000' WHERE PR_ID_008=5377;
UPDATE Q0208T00 SET PR_COD_008='EB2-1178/87-LE-000' WHERE PR_ID_008=5379;
UPDATE Q0208T00 SET PR_COD_008='EB2-1377/86-LE-000' WHERE PR_ID_008=5558;
UPDATE Q0208T00 SET PR_COD_008='EB1-0196/85-LE-000' WHERE PR_ID_008=4989;

/*Nuevas tablas auxiliares en el mto de tablas auxiliares*/
INSERT INTO Q0298T00 (TAB_ID_098,TAB_DENOC_098,TAB_DENOE_098) VALUES ('Q0258T00','TIPO DE COMPROMISOS CONVENIO',NULL);
INSERT INTO Q0298T00 (TAB_ID_098,TAB_DENOC_098,TAB_DENOE_098) VALUES ('Q0257T00','TIPO DE PROYECTOS VIVIENDA',NULL);

commit;