-- modificar descripcion del tramite
update ab03b02t00 
set DESC_ES_002 = 'Apertura de Expediente en Sede Eléctronica',
DESC_EU_002 = 'Espediente irekitzea Egoitza Electronikoan'
where id_001_fase = 1 and id_002 = 3;

update ab03b18t00 
set DESC_ES_018 = 'Apertura de Expediente en Sede Eléctronica',
DESC_EU_018 = 'Espediente irekitzea Egoitza Electronikoan'
where id_018 = 3 and ID_017_FASE = 1;

commit;

-- modificarion campo resumen actuacion aumento de caracteres
ALTER TABLE AB03B10T00 MODIFY RESUMEN_ACTUAC_EU_010 VARCHAR2(4000 BYTE);

-- campo nuevo para almacenar resultado del archivado de expedientes
ALTER TABLE AB03B10T00 ADD (EXP_ARCHIVADO_010 NUMBER(1,0) default 0);
COMMENT ON COLUMN AB03B.AB03B10T00.EXP_ARCHIVADO_010 IS '0:Sin marcar, 1:Marcada para archivar, 2:Archivado, 3:Error al archivar';


-- Tabla nueva para los errores de inicio de expediente
 CREATE TABLE AB03B.AB03B66T00
   (	"ID_066" NUMBER(8,0) NOT NULL ENABLE, 
	"ID_PROV_066" VARCHAR2(2 BYTE) NOT NULL ENABLE, 
	"ID_ANYO_066" NUMBER(4,0) NOT NULL ENABLE, 
	"ID_EXP_066" NUMBER(8,0) NOT NULL ENABLE, 
	"ID_TIPO_066" NUMBER(1,0) NOT NULL ENABLE,
	"ERROR_066" VARCHAR2(500 BYTE), 
	"FECHA_066" TIMESTAMP (6), 
	 CONSTRAINT "PK_AB03B66T00" PRIMARY KEY ("ID_066")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "AB0301E00"  ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "AB0301E00" ;
  
  CREATE SEQUENCE  "AB03B"."SEQ_AB03B66T00_ID_066"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 45 NOCACHE  NOORDER  NOCYCLE ;
  
  COMMENT ON COLUMN "AB03B"."AB03B66T00"."ID_066" IS 'PF Secuencial de la tabla';
  COMMENT ON COLUMN "AB03B"."AB03B66T00"."ID_PROV_066" IS 'Provincia del expediente';
  COMMENT ON COLUMN "AB03B"."AB03B66T00"."ID_ANYO_066" IS 'Ano del expediente';
  COMMENT ON COLUMN "AB03B"."AB03B66T00"."ID_EXP_066" IS 'Id expediente';
  COMMENT ON COLUMN "AB03B"."AB03B66T00"."ID_TIPO_066" IS '0-Amianto, 1-RERA';
  COMMENT ON COLUMN "AB03B"."AB03B66T00"."ERROR_066" IS 'Error que se ha producido';
  COMMENT ON COLUMN "AB03B"."AB03B66T00"."FECHA_066" IS 'Fecha del error';
  
 COMMENT ON TABLE "AB03B"."AB03B66T00"  IS 'Tabla de errores al dar de alta en sede electronica';
 
