DROP TABLE EXT_DWHT_VOLUMI_AOM;

CREATE TABLE EXT_DWHT_VOLUMI_AOM
(
  MSISDN            VARCHAR2(40 BYTE),
  CODICE_OPERATORE  VARCHAR2(6 BYTE),
  NC                NUMBER,
  DC                NUMBER
)
ORGANIZATION EXTERNAL
  (  TYPE ORACLE_LOADER
     DEFAULT DIRECTORY DBCGO_DWHT_PATH
     ACCESS PARAMETERS 
       ( RECORDS DELIMITED BY NEWLINE
        BADFILE 'ext_dwht_volumi_aom.bad'
        LOGFILE 'ext_dwht_volumi_aom.log'
        FIELDS TERMINATED BY ';'
       )
     LOCATION (DBCGO_DWHT_PATH:'DWHT_VOLUMI_AOM.DAT')
  )
REJECT LIMIT UNLIMITED
PARALLEL 3
NOMONITORING;

ALTER TABLE DWHT_VOLUMI_AOM1
		DROP CONSTRAINT DWHT_VOLUMI_AOM1_PK; 

ALTER TABLE DWHT_VOLUMI_AOM0
		DROP CONSTRAINT DWHT_VOLUMI_AOM0_PK;
		

ALTER TABLE DWHT_VOLUMI_AOM1 ADD
CONSTRAINT DWHT_VOLUMI_AOM1_PK
 PRIMARY KEY (MSISDN, CODICE_OPERATORE)
 USING INDEX 
 TABLESPACE DBCGO_IDX_BIG;

ALTER TABLE DWHT_VOLUMI_AOM0 ADD
CONSTRAINT DWHT_VOLUMI_AOM0_PK
 PRIMARY KEY (MSISDN, CODICE_OPERATORE)
 USING INDEX 
 TABLESPACE DBCGO_IDX_BIG;
