--UPDATE FROM 8.6.4.5 TO 8.6.4.6


DROP TABLE VERSION_8_6_4_5;



/*  VERSION_8_6_4_6  */
CREATE TABLE VERSION_8_6_4_6 (
	 DUMMY	NUMBER	    NULL
)
;


CREATE TABLE WTWN
(
  WTWN_ID    NUMBER(30) NOT NULL,
  WTWN_CODE  VARCHAR2(9) NOT NULL,
  WTWN_TOWN  VARCHAR2(40) NOT NULL,
  CONSTRAINT WTWN_PK PRIMARY KEY (WTWN_ID) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8CONF;

CREATE SEQUENCE SEQ_WTWN INCREMENT BY 1 START WITH 1000 NOMAXVALUE MINVALUE 1 NOCYCLE NOCACHE NOORDER;

COMMENT ON TABLE WTWN IS 'contains town and code for italian police export';

COMMENT ON COLUMN WTWN.WTWN_ID IS 'wtwn_id identifies wtwn';

COMMENT ON COLUMN WTWN.WTWN_CODE IS 'wtwn_code is the standard police code';

COMMENT ON COLUMN WTWN.WTWN_TOWN IS 'wtwn_town is the name of the town';

ALTER TABLE XPDC ADD (XPDC_ISSUE_WTWN_ID NUMBER(30), XPDC_BORN_WTWN_ID NUMBER(30));

ALTER TABLE XADR ADD (XADR_WTWN_ID NUMBER(30));

UPDATE WTWN SET WTWN_TOWN=TRIM(WTWN_TOWN);

